Opened 13 years ago

Closed 13 years ago

#31776 closed defect (fixed)

.tbz2 files are not plain text files

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: wsiegrist@…
Priority: Normal Milestone:
Component: server/hosting Version:
Keywords: Cc:
Port:

Description

I just tried to download an archive by accessing this URL in the browser:

http://packages.macports.org/libiconv/libiconv-1.14_0.darwin_10.x86_64.tbz2

The browser began displaying it as if it were a text file, because the server is delivering it with the text/plain MIME type. This is not a plain text file and should be served with the application/octet-stream MIME type, or better yet the proper MIME type, whatever that is (I've seen various options:

  • application/bzip2
  • application/x-bz2
  • application/x-bzip
  • application/x-bzip2
  • application/x-bzip-compressed-tar

).

If the distfiles server is a different machine from the packages server, it also needs such a change; see:

http://distfiles.macports.org/libmowgli/libmowgli-0.7.1.tbz2

Change History (2)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

In addition to fixing the MIME type for .tbz2 files specifically, since the purpose of the packages and distfiles servers is to distribute non-text files, it would be good to change the default MIME type to application/octet-stream. That's this directive in httpd.conf:

#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

comment:2 Changed 13 years ago by wsiegrist@…

Resolution: fixed
Status: newclosed

Fixed

Note: See TracTickets for help on using tickets.