Project

General

Profile

ActionsLike0

Feature #3622

closed

Net::HTTP does not wait to send request body with Expect: 100-continue

Added by drbrain (Eric Hodel) over 14 years ago. Updated almost 14 years ago.

Status:
Closed
Target version:
[ruby-core:31519]

Description

=begin
HTTP/1.1 allows a client to determine if the server will accept a request body using the Expect header with a value of 100-continue. If the server finds the request header the client sent acceptable it will return with a 100 Continue response and the client will then send the request body.

Instead of waiting for a 100 Continue response Net::HTTP immediately sends the request body and ignores any 100 Continue responses.

The current behavior defeats the purpose of the Expect: 100-continue value and the 100 Continue response code.

If I am attempting to upload a large file like a photo and to a server that requires HTTP authentication I will have to wait until the upload is complete before I can retrieve a 401 response for incorrect authentication.

I have attached a proposed patch that adds a continue timeout. Net::HTTP will wait up to the continue timeout before sending the request body.
=end


Files

net.http.continue.patch (3.39 KB) net.http.continue.patch Proposed Net::HTTP that waits for a continue response drbrain (Eric Hodel), 07/28/2010 03:08 PM
net.http.continue.patch (3.42 KB) net.http.continue.patch net.http.continue.2.patch drbrain (Eric Hodel), 07/29/2010 05:17 AM
expect-continue.diff (3.35 KB) expect-continue.diff nahi (Hiroshi Nakamura), 09/09/2010 05:24 PM
expect-continue.diff (5.88 KB) expect-continue.diff nahi (Hiroshi Nakamura), 09/10/2010 07:40 PM
expect-continue.3.diff (6.28 KB) expect-continue.3.diff drbrain (Eric Hodel), 09/11/2010 05:26 AM

Added by Hiroshi Nakamura almost 14 years ago

Revision b219a56c

  • lib/net/http.rb, lib/net/protocol.rb: Allow to configure to wait
    server returning '100 continue' response befor sending HTTP request
    body. See NEWS for more detail. See #3622.
    Original patch is made by Eric Hodel .

  • test/net/http/test_http.rb: test it.

  • NEWS: Add new feature.

On my env (Ubuntu 11.04 64bit),
9510 tests, 2203824 assertions, 0 failures, 0 errors, 29 skips
->
9514 tests, 2203836 assertions, 0 failures, 0 errors, 29 skips

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

ActionsLike0

Also available in: Atom PDF