Mercurial > hg
view tests/test-issue1306.out @ 12570:a72c5ff1260c stable
Correct Content-Type header values for archive downloads.
The content type for both .tar.gz and .tar.bz2 downloads was
application/x-tar, which is correct for .tar files when no
Content-Encoding is present, but is not correct for .tar.gz and .tar.bz2
files unless Content-Encoding is set to gzip or x-bzip2, respectively.
However, setting Content-Encoding causes browsers to undo that encoding
during download, when a .gz or .bz2 file is usually the desired
artifact. Omitting the Content-Encoding header is preferred to avoid
having browsers uncompress non-render-able files.
Additionally, the Content-Disposition line indicates a final desired
filename with .tar.gz or .tar.bz2 extension which makes providing a
Content-Encoding header inappropriate.
With the current configuration browsers (Chrome and Firefox thus far)
are registering the application/x-tar Content-Type and not .tar
extension and appending that extension, yielding filename.tar.gz.tar as
a final on-disk artifact. This was originally reported here:
http://stackoverflow.com/questions/3753659
I've changed the .tar.gz and .tar.bz2 Content-Type values to
application/x-gzip and application/x-bzip2, respectively. Which yields
correctly named download artifacts on Firefox, Chrome, and IE.
author | Ry4an Brase <ry4an-hg@ry4an.org> |
---|---|
date | Mon, 20 Sep 2010 14:56:08 -0500 |
parents | a3d73b3e1f8a |
children |
line wrap: on
line source
% initialize remote repo with branches adding a marked working directory as branch br adding c changeset: 2:1630aed6ed2b branch: br tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: c changeset: 1:234f53e6c5ff branch: br user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a % try cloning -r branch requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 2 files updating to branch br 2 files updated, 0 files merged, 0 files removed, 0 files unresolved changeset: 2:1630aed6ed2b branch: br tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: c % try cloning -rother clone#branch requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 2 files updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a % try cloning -r1 clone#branch requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 2 files updating to branch br 1 files updated, 0 files merged, 0 files removed, 0 files unresolved changeset: 1:234f53e6c5ff branch: br user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b