Hi edvakf,

On Wed, Aug 12, 2009 at 11:19 PM, edvakf<taka.atsu...@googlemail.com> wrote:
>
> I found the part of the code where gzip file was magically unzipped.
>
> /Applications/GoogleAppEngineLauncher.app/Contents/Resources/
> GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
> google/appengine/api/urlfetch_stub.py
> =====================================================
>        if http_response.getheader('content-encoding') == 'gzip':
>          gzip_stream = StringIO.StringIO(http_response_data)
>          gzip_file = gzip.GzipFile(fileobj=gzip_stream)
>          http_response_data = gzip_file.read()
>        response.set_content(http_response_data[:MAX_RESPONSE_SIZE])
> =====================================================

urlfetch_stub is only used in the dev_appserver - this code does not
run in production.

Nevertheless, this is the correct behaviour if the server you're
contacting is setting the "Content-Encoding" header. This header
specifies that the content is not a gzip file, but is merely being
transmitted gzip-encoded. To send a .gz file, the content-encoding
header should be omitted, but the content-type header should be set to
application/x-gzip.

-Nick Johnson

>
> I wonder it's a good behavior. The downloaded data is less than 1MB,
> but since the unzipped data is more than that, it's truncated.
>
> I believe truncation should occur only when the downloaded data is
> more than 1MB.
> What does everyone think?
> >
>



-- 
Nick Johnson, Developer Programs Engineer, App Engine

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to