|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69357 HTTP/1.1 100 Continue overriding subsequent 200 response code with PUT request
Submitted: 2015-04-02 13:51 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: php at qzxj dot net Assigned:
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.6.7 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php at qzxj dot net
New email:
PHP Version: OS:


 [2015-04-02 13:51 UTC] php at qzxj dot net
We have observed some new and unexpected behaviour with PUT requests since upgrading from 2.2 to 2.4.1. A PUT request which triggers a HTTP/1.1 100 Continue followed by a 200 OK returns 100 when getResponseCode() is called.

I have supplied a fairly terrible server script below that returns exactly the same response structure as the server we're interacting with which is causing the problem for us.

The request headers I see using both 2.2 and 2.4.1 are the same (apart from the version number in the UA, of course):

PUT / HTTP/1.1
User-Agent: PECL_HTTP/2.4.1 PHP/5.6.7 libcurl/7.37.1
Host: localhost:8081
Accept: */*
Content-Length: 3
Expect: 100-continue

Using 2.2, the client script below shows a response code of 200. Using 2.4.1, it shows 100.

Test script:
if ($argv[1] == 'server') {
    $s = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
    socket_set_option($s, SOL_SOCKET, SO_REUSEADDR, 1);
    socket_bind($s, "", 8081);
    while (true) {
        $c = socket_accept($s);
        $h = socket_read($c, 8192);
        echo $h;
        socket_write($c, "HTTP/1.1 100 Continue\r\n\r\n");
        socket_write($c, implode("\r\n", [
            "HTTP/1.1 200 OK",
            "Content-Length: 3",
            "Content-Type: text/plain",
elseif ($argv[1] == 'client') {
    $rq = new \Http\Client\Request('PUT', 'http://localhost:8081/', [], 
        (new \Http\Message\Body)->append("foo")
    $c = new \Http\Client;
    $rs = $c->enqueue($rq)->send()->getResponse();


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-08 10:06 UTC]
Automatic comment on behalf of mike
Log: fix bug #69357
 [2015-04-08 10:06 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 28 20:01:24 2023 UTC