Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I block HTTP 1.0 request? [closed]

I use $_SERVER['HTTP_HOST'] for absolute url paths in my website. But, often, I find nginx error logs of HTTP/1.0 requests with undefined HTTP_HOST.

Is it advisable to block these requests? What's the best way to block them?

like image 555
Medical physicist Avatar asked Oct 02 '22 01:10

Medical physicist


1 Answers

Is it advisable to block these requests?

If your application cannot serve anything meaningful without the host, then it's IMO advisable. Furthermore I couldn't find anything in HTTP 1.1 which says applications have to be backward compatible.

What's the best way to block them?

Answer them with 505 HTTP Version Not Supported.

like image 182
Markus Malkusch Avatar answered Oct 13 '22 11:10

Markus Malkusch