Bugs: Browse | Submit New | Admin

[#14666] Net::HTTP#request sends body before receiving 100 Continue

Date:
2007-10-12 19:58
Priority:
3
Submitted By:
Tim Olsen (tolsen718)
Assigned To:
Akinori MUSHA (knu)
Category:
Network / Comm / Protocols
State:
Open
Platform:
 
Summary:
Net::HTTP#request sends body before receiving 100 Continue

Detailed description
RFC 2616 states "The purpose of the 100 (Continue) status (see Section 10.1.1) is to allow a client that is sending
a request message with a request body to determine if the origin server is willing to accept the request (based on the
request headers) before the client sends the request body."

Unfortunately, even if an Expect: 100-continue header is set, ruby's Net::HTTP#request still sends the body before receiving
a 100 Continue.

See Net::HTTP#transport_request :

    def transport_request(req)
      begin_transport req
      req.exec @socket, @curr_http_version, edit_path(req.path)
      begin
        res = HTTPResponse.read_new(@socket)
      end while res.kind_of?(HTTPContinue)
      res.reading_body(@socket, req.response_body_permitted?) {
        yield res if block_given?
      }
      end_transport req, res
      res
    end

It's inside the req.exec() call that the body is sent.  This is done before any response is read.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-11-08 00:38
Sender: Roger Pack

If this is still a concern then could you submit a new copy to
the new tracker:
http://redmine.ruby-lang.org/
--this tracker is being shelved.
Thanks!
-=R

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item