With Chrome 12.0.742.112, if I redirect with the following headers:(对于Chrome 12.0.742.112,如果我使用以下标头重定向:)
HTTP/1.1 302 Found
Location: http://0.0.0.0:3000/files/download.zip
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
X-Ua-Compatible: IE=Edge
X-Runtime: 0.157964
Content-Length: 0
Server: WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18)
Date: Tue, 05 Jul 2011 18:42:25 GMT
Connection: Keep-Alive
Which if followed returns the following header:(如果遵循,则返回以下标头:)
HTTP/1.1 200 OK
Last-Modified: Tue, 05 Jul 2011 18:18:30 GMT
Content-Type: application/zip
Content-Length: 150014
Server: WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18)
Date: Tue, 05 Jul 2011 18:44:47 GMT
Connection: Keep-Alive
Chrome will not redirect, nor change the previous page, it'll just report the following warning in the console:(Chrome不会重定向,也不会更改上一页,它只会在控制台中报告以下警告:)
Resource interpreted as Document but transferred with MIME type application/zip.(资源被解释为文档,但以MIME类型application / zip传输。)
The process works correctly in Firefox, and also works fine in Chrome if I open a new tab and go directly to http://0.0.0.0:3000/files/download.zip
.(如果我打开一个新标签页并直接转到http://0.0.0.0:3000/files/download.zip
,则该过程在Firefox中可以正常运行,在Chrome中也可以正常运行。) Am I doing something wrong, or is this a bug/quirk of Chrome?(我是在做错什么,还是Chrome的错误/怪癖?)
ask by Ashley Williams translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…