1

我在 Google Cloud Storage 上托管了一个 FireFox 插件。为了被 FireFox 正确处理,Content-Type 需要设置为 application/x-xpinstall

我已上传如下:

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 访问时,标头恢复为 application/octet-stream

$ 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

这是一个错误还是我需要更改我的配置?

4

1 回答 1

1

上面的两个结果在 x-goog-generation 和 x-goog-metageneration 中具有不同的值,这让我怀疑您已经多次上传对象,并且您看到的结果来自不同版本(Content-类型)。您是否为存储桶启用了版本控制?如果没有,那么其中一条路径可能正在进行一些缓存。你还在看到这种行为吗?

于 2013-03-05T07:31:12.387 回答