Ruby Issue Tracking System: Issueshttps://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-12-15T06:01:34ZRuby Issue Tracking System
Redmine Ruby master - Feature #5764 (Assigned): Net::HTTP should assume HTTP/0.9 on unexpected responseshttps://bugs.ruby-lang.org/issues/57642011-12-15T06:01:34Zmstyer (Mike Styer)michael@styer.net
<p>Currently Net::HTTP.read_status_line throws Net::HTTPBadResponse if the status line does not conform to HTTP/1.1 specifications.</p>
<p>But in cases when the web server implements a request size limit, it may not read HTTP/1.1 trailer after the request URI and may send back an HTTP/0.9 response.</p>
<p>Nginx does this for 414 Request-URI Too Large responses:</p>
<p><a href="http://lxr.evanmiller.org/http/source/http/ngx_http_header_filter_module.c#L95" class="external">http://lxr.evanmiller.org/http/source/http/ngx_http_header_filter_module.c#L95</a><br>
<a href="http://forum.nginx.org/read.php?2,52862,52862" class="external">http://forum.nginx.org/read.php?2,52862,52862</a></p>
<p>Perl's Net::HTTP provides a "laxed" option to read_response_headers() to assume HTTP/0.9 if it can't find an HTTP/1.1 status line. Ruby should provide a similar option.</p>