2013-02-28 52 views
1

我在Google云端存储上托管FireFox插件。为了火狐妥善处理,需要的内容类型设置为应用程序/ x-xpinstall使用自定义URL时丢失了内容类型标头

我已经上传如下:

gsutil -h "Content-Type: application/x-xpinstall" cp -a public-read \ 
    ActivityInfo.xpi gs://download.activityinfo.org 

当从标准端点访问,一切是正确的:

$ curl -s -D - http://commondatastorage.googleapis.com/download.activityinfo.org/ActivityInfo.xpi \ 
    -o /dev/null 

HTTP/1.1 200 OK 
Server: HTTP Upload Server Built on Feb 13 2013 15:53:33 (1360799613) 
Expires: Thu, 28 Feb 2013 12:38:30 GMT 
Date: Thu, 28 Feb 2013 11:38:30 GMT 
Last-Modified: Thu, 28 Feb 2013 11:38:01 GMT 
ETag: "1ee983889c947a204eab4db6902c9a67" 
x-goog-generation: 1362051481261000 
x-goog-metageneration: 1 
Content-Type: application/x-xpinstall 
Content-Language: en 
x-goog-crc32c: a11b93ab 
Accept-Ranges: bytes 
Content-Length: 5562 
Cache-Control: public, max-age=3600, no-transform 
Age: 491 

但是当我尝试从自定义域download.activityinfo.org访问,头部返回到应用程序/八位字节流

$ curl -s -D - http://download.activityinfo.org/ActivityInfo.xpi -o /dev/null  
HTTP/1.1 200 OK 
Server: HTTP Upload Server Built on Feb 13 2013 15:53:33 (1360799613) 
Expires: Thu, 28 Feb 2013 12:10:24 GMT 
Date: Thu, 28 Feb 2013 11:10:24 GMT 
Last-Modified: Wed, 27 Feb 2013 20:36:24 GMT 
ETag: "1ee983889c947a204eab4db6902c9a67" 
x-goog-generation: 1361997384772000 
x-goog-metageneration: 2 
Content-Type: application/octet-stream 
x-goog-crc32c: a11b93ab 
Accept-Ranges: bytes 
Content-Length: 5562 
Cache-Control: public, max-age=3600, no-transform 
Age: 2298 

我已经设置了CNAME到c.storage.googleapis.com%的文档

$ nslookup download.activityinfo.org 
Non-authoritative answer: 
Server: Comtrend.Home 
Address: 192.168.1.1 

Name: storage.l.googleusercontent.com 
Addresses: 2a00:1450:400c:c00::80 
      173.194.78.128 
Aliases: download.activityinfo.org 
     c.storage.googleapis.com 

这是bug还是我需要改变我的配置?

回答

1

上面的两个结果在x-goog-generation和x-goog-metageneration中有不同的值,这让我怀疑你不止一次上传了这个对象,并且你看到了不同版本的结果(它们有不同的结果Content-Type的值)。您是否为桶启用了版本控制?如果没有,那么在其中一条路径上可能会发生一些缓存。你仍然看到这种行为?

+0

就是这样!此域名已启用Cloudflare。感谢锐利的眼睛! – akbertram 2013-03-06 08:05:30