简体   繁体   中英

Why isn't the X-Appengine-Inbound-Appid header added?

I'm sending a request from one module to another in the same app, using the URL fetch service , which says that if you set the follow_redirects parameter to False , the X-Appengine-Inbound-Appid header will be added to the request.

So I'm using the following call:

answer = urlfetch.fetch(url, follow_redirects=False)

but the header isn't appearing. I'm getting:

[('User-Agent', 'AppEngine-Google; (+http://code.google.com/appengine)'),
 ('X-Appengine-Country', 'ZZ'),
 ('Host', '127.0.0.1:8081'),
 ('Content_Length', '0')]

Is this something that doesn't work on the development server? Is there some bit of the documentation that I've missed somewhere?

(for the moment I'm working round the problem by adding my own header to check that the request is coming from the right place, but that's not the Right Way of doing it)

After a lot of experiments I found the issue. This header is only set if you call your app on the appspot.com domain. If your app has a custom domain, such as example.com and you call that URL you will not see the header. You must call example.appspot.com.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM