Project

General

Profile

Actions

Feature #5764

open

Net::HTTP should assume HTTP/0.9 on unexpected responses

Added by mstyer (Mike Styer) over 12 years ago. Updated over 4 years ago.

Status:
Assigned
Target version:
-
[ruby-core:41657]

Description

Currently Net::HTTP.read_status_line throws Net::HTTPBadResponse if the status line does not conform to HTTP/1.1 specifications.

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.

Nginx does this for 414 Request-URI Too Large responses:

http://lxr.evanmiller.org/http/source/http/ngx_http_header_filter_module.c#L95
http://forum.nginx.org/read.php?2,52862,52862

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.

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Assignee set to naruse (Yui NARUSE)
  • Tracker changed from Bug to Feature
  • Project changed from Ruby 1.8 to Ruby master
  • Status changed from Open to Assigned
  • ruby -v deleted (ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.1.0] )

This appears to still be the case in master, but I think this is a feature request for a "laxed" option. I'm not sure if we want to support such an option though.

Actions

Also available in: Atom PDF

Like0
Like0