Search code examples
pythonajaxgoogle-chromegoogle-app-enginegmail

How Gmail makes it?


I am developing service similar to banatag. During new feature developmnet I found unexplainable behaviour of Gmail(as I think).

I'll try to explain my question in picture:

  1. Create tag(image that I will request). Now nobody requests it

  2. Add it by URL to email. Url of image http://eggplant-tag.appspot.com/request?FT1R3WECWNTM2ZGUDXRMA8VOXJ4F6TI4

  3. There are two new AJAX requests from page, but there aren't to my domain

  4. Looking for my service. There is request from my IP, with Google User-Agent

What does request this image(tag)? I see two possibilities:

  • page make AJAX requests to my service, that's why I see my IP. But in this case, why I couldn't see this request in Network tab of Developer Console?

  • Google Image Proxy service requests to my service, but why in this case there is my IP in request?

My IP:

[UPD] Add part of class that handles requests to image(tag):

...
request.remoteAddress = str(self.request.remote_addr)# save remote address
request.put()
...
self.response.write(simpleImageData) #write to body binary data of 1x1 transparent image
self.response.headers[ 'Content-Type' ] = 'image/png'
self.response.headers[ 'Cache-Control' ] = 'no-cache, no-store, must-revalidate'
self.response.headers[ 'Pragma' ] = 'no-cache'
self.response.headers[ 'Expires' ] = '0'

[UPD 2]

I used wireshark to found requests to my service, but there are not any. That's why main question is how Google User Content simulate my IP address?


Solution

  • I deployed my app on my notebook, then I tried to repeat my actions.

    Result confirmed my guess that Google Proxy and App Engine works together, and when Google proxy server requests my app, I see my IP.

    In my experiment I saw IP of Google proxy.