8

After the AppEngine API update that came out a few weeks ago, the wonderful "Disallowed HTTP Response Headers" section appeared in the Python Response class documentation here, which explains that the listed headers cannot be set for security purposes.

That is all well and good except that now all of my blob downloads have unknown lengths, causing all major browsers show unknown length progress indicators! Suffice it to say that users (and myself) find this quite annoying for large downloads, as there is no way to guess how long the download will take, or how far along they may be. I fixed this before by setting the Content-Length header based on the blob's info records in the datastore, but now that that is disallowed, is there another way to accomplish this? Any ideas much appreciated!

Jordan
  • 31,971
  • 6
  • 56
  • 67
Collin Arnold
  • 229
  • 1
  • 5
  • I haven't found a workaround or alternate approach to sidestep this issue, so I've filed a bug with the GAE team to hopefully raise the restriction on setting this header - http://code.google.com/p/googleappengine/issues/detail?id=4310 – Collin Arnold Dec 27 '10 at 02:43
  • minor nit: this should be tagged google-app-engine and not gae-datastore. – ryan Jan 28 '11 at 21:33

1 Answers1

1

Are your files transferred with

Transfer-Encoding: Chunked

Then it is possible over HTTP to send these files without the Content-Length: header. See the HTTP/1.1 RFC on Chunked Transfer Coding. I guess you should be able to define your own handler for the methods such as get etc, and create yourself the HTTP responses using webapp.WSGIApplication. OTOH, Adrian Holovaty never received an answer to this same question.

graemeboy
  • 590
  • 4
  • 11
karlcow
  • 6,977
  • 4
  • 38
  • 72