8

在几周前发布的 AppEngine API 更新之后,精彩的“Disallowed HTTP Response Headers”部分出现在 Python Response 类文档here中,它解释了出于安全目的不能设置列出的 headers。

这一切都很好,只是现在我所有的 blob 下载都有未知长度,导致所有主要浏览器都显示未知长度进度指示器!可以说用户(和我自己)觉得这对于大型下载非常烦人,因为无法猜测下载需要多长时间,或者它们可能会走多远。我之前通过Content-Length根据数据存储区中 blob 的信息记录设置标头来解决此问题,但现在这是不允许的,还有其他方法可以实现吗?任何想法都非常感谢!

4

1 回答 1

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.

于 2011-02-02T23:14:59.383 回答