ysbaddaden / prax

Rack proxy server for development
http://ysbaddaden.github.io/prax/
Other
475 stars 49 forks source link

Crashes on nil host header #113

Closed ysbaddaden closed 9 years ago

ysbaddaden commented 9 years ago

Prax workers regularly crash with undefined method 'split' for nil:NilClass. It appears some HTTP requests are missing a Host: myapp.dev header. I'm missing some request examples as to why they don't send a host header —it's mandatory in HTTP/1.1 and I don't see why browsers would suddenly send HTTP/1.0 requests without a hostname.

Prax should anyway reply with a 400 BAD REQUEST when the host can't be determined.

ysbaddaden commented 9 years ago

I still don't know why browsers send some requests without a Host header, but at least Prax won't crash anymore but reply with a Bad Request.