views:

344

answers:

2

Documentation says (http://code.google.com/appengine/docs/java/urlfetch/overview.html#Request_Headers):

These headers are set to accurate values by App Engine, as appropriate

Does the value for X-Forwarded-For included some identity of the gae application?

+1  A: 

Currently, X-Forwarded-For appears to be unset in requests made by URLFetch.

You can verify this for yourself by going to http://shell.appspot.com/ and doing a URLFetch for a site that echoes HTTP requests - for example, http://www.showhttprequest.com/ . App Engine sets the User Agent string to "AppEngine-Google; (+http://code.google.com/appengine)", but doesn't set X-Forwarded-For at all.

Nick Johnson
A: 

If you go to shell.appspot.com and run the following code:

from google.appengine.api import urlfetch
url = 'http://www.showhttprequest.com/'
result = urlfetch.fetch(url)
print result.content

You will see that (as of sometime near the end of 2009) AppEngine now puts the appid into the user-agent header. So your user-agent ends up looking like:

AppEngine-Google; (+http://code.google.com/appengine; appid: shell)
ade