php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #57426 No way to disable the 'Expect' header on http requests
Submitted: 2006-12-13 22:09 UTC Modified: 2007-02-15 09:38 UTC
From: tjerk dot meesters at muvee dot com Assigned: mike (profile)
Status: Not a bug Package: pecl_http (PECL)
PHP Version: 5.2.0 RC4 OS: Windows XP Pro
Private report: No CVE-ID: None
 [2006-12-13 22:09 UTC] tjerk dot meesters at muvee dot com
Description:
------------
During the implementation of a remote API, I ran into some problems when uploading files to a lighttpd server. The error returned from the server is '417 - Expectation failed'.

When I upload to an Apache server, this problem doesn't occur, but what I did notice was an unusual header in the request arguments:

Except: 100-continue

Is there a way to disable this particular feature? Maybe by switching back to HTTP/1.0 instead of HTTP/1.1?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-13 22:53 UTC] tjerk dot meesters at muvee dot com
I found the problem(s):
1) lighttpd doesn't support HTTP/1.1 Expect
2) Changing the protocol is easier than I though (although it's not particularly well documented)

$req->setOptions(array(
  'protocol' => HTTP_VERSION_1_0,
));
 [2007-01-12 10:23 UTC] mike@php.net
You can also disable the Expect header with $r->setHeaders(array("Expect"=>null));
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC