Welcome! Log In Create A New Profile

Advanced

default_type should default to nothing (RFC 2616)

April 29, 2009 10:41PM
I am new to nginx but I just noticed that, at least on ubuntu,

[code]default_type application/octet-stream;[/code]

is the default setting, and the wiki says that if I remove it, the default will go to text/plain. This is not good!

For an extremely detailed discussion of this issue, please see the resolved/fixed bug for apache:
https://issues.apache.org/bugzilla/show_bug.cgi?id=13986

The crux of the conclusion is from this passage in RFC 2616 ( http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.1 ):

[quote] Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream". [/quote]

Note that in this context "SHOULD" means it's advised but not mandatory. In particular. The receiver is ONLY allowed to guess the type if the media type is missing. Now, IE ignores that rule, but Mozilla does not, which is why the Mozilla engineers wanted so badly for apache to change the setting! Per RFC 2046, "application/octet-stream" actually means "arbitrary binary data" which the application is recommended to simply save (not try to guess the type). ( http://www.ietf.org/rfc/rfc2046.txt section 4.5.1 )

I hope you can allow me to set default_type to None or leave it unset and have nginx send no Content-Type header. Thanks!
Subject Author Posted

default_type should default to nothing (RFC 2616)

sbwoodside April 29, 2009 10:41PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready