AppEngine App头中没有X-AppEngine-Region?
我正在试图让请求中的国家/地区。 我认为有可能在X-AppEngine-Country
每个请求中获得X-AppEngine-Region
和X-AppEngine-Country
头文件,但是它们缺失。 有时标题是临时的,有时他们是这样的(只列出键):
alt-svc content-length content-type date etag server status via x-powered-by
这是我的代码。 我还需要做些什么来获得地区和国家呢?
app.get('/', (req, res) => { res.status(200).send(req.headers['X-AppEngine-Region'] || ''); }); app.post('/ping', (req, res) => { res.status(200).send(req.headers['X-AppEngine-Region'] || ''); });
这些头文件在nodejs env中不可用,Go,Java,PHP和标准env(不灵活)都可用。
更多: https : //cloud.google.com/appengine/docs/flexible/nodejs/how-requests-are-handled
- 在express.js中使用htmlstring来提供静态文件
- ExpressJS + NodeJS服务器不会提供CSS文件
- 如何在Express(Node.js)模板中为Internet Explorer保留有条件的CSS语句
- 麻烦authentication
- 如何通过Angular,Express和Mongoose执行请求放置?
- IDE或Node.js + Express和CoffeeScript的编辑器
- JSON嵌套对象与node.js中的BodyParserparsing
- 当express.static(__ dirname)函数在node.js中使用express时,redirect到错误的html页面
- 使用相对URL从NodeJS / Express实例执行Python脚本