Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.2.1

Request #19233 Posting file with digest auth means files is uploaded twice
Submitted: 2012-01-21 20:31 UTC Modified: 2014-01-12 20:37 UTC
From: richardy Assigned: avb
Status: Closed Package: HTTP_Request2 (version 2.0.0)
PHP Version: 5.3.5 OS: Windows 7
Roadmaps: (Not assigned)    
Subscription  


 [2012-01-21 20:31 UTC] richardy (Richard Yeo)
Description: ------------ When posting params and files in a single request and using digest authentication it appears the default adapter (socket) is uploading the contents twice. This is very inefficient especially with large files. Curl adapter has documented issue with uploading files with digest auth which means I can't use that(?) If we know target URL is going to require Digest authentication can we do first call to get 401 without uploading data and only upload data with second call? If package doesn't support can it be enhanced to? You appear to be able to do this with Ruby. I think this is a great package and it would be even better if it could support this.

Comments

 [2014-01-11 17:42 UTC] avb (Alexey Borzov)
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: avb
Looks like we need to use "Expect: 100-continue" header and only send the body if we receive "100 Continue" response status and not "401 Unauthorized" http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3
 [2014-01-12 20:37 UTC] avb (Alexey Borzov)
-Status: Analyzed +Status: Closed
Implemented in Git https://github.com/pear/HTTP_Request2/commit/73d2858bcd0fe84d6925785d840f91d2e60d49f8 Socket adapter will send "Expect: 100-continue" header and wait for "100 Continue" response by default before sending large request body. This can be prevented like described in bug #15937 for Curl adapter, by setting an empty 'Expect' header.