Welcome! Log In Create A New Profile

Advanced

Always Return Headers In Every Request

Posted by zedshaw 
Always Return Headers In Every Request
December 08, 2009 04:42PM
Try this:

curl -i http://zedshaw.com/

You see the headers?

Ok, now try this:

curl -i "http://zedshaw.com/this has spaces in it.txt"

No headers, and it's a 400. This means that it defaults to a 200 status code, meaning that it breaks quite a few things about HTTP.

The feature should either be:

* Always return headers, no matter what.

OR

* If you want to save time on a malformed request, and headers are too much work, then just close the connection. That's still valid and will work with most clients.

Thanks!
Re: Always Return Headers In Every Request
December 11, 2009 12:05PM
This looks more like a bug. Stable release does it do too, not that any normal browser allows spaces in urls (they will be encoded).
Re: Always Return Headers In Every Request
December 14, 2009 06:24AM
Ok, correction: this isn't a bug. When you send a completly illegal request header (you can't have spaces in the url, just url encoded space), nginx can't read the HTTP version (GET http://zedshaw.com/this has spaces in it.txt HTTP/1.1). By that nginx thinks it is a pre 1.0 HTTP request (0.9), and then the server shouldn't sent headers. So what nginx doing is completly logical and correct on this request.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready