Bug #66439 [NEW]: Read from php://input on PUT request hanging

From: Date: Wed, 08 Jan 2014 13:10:47 +0000
Subject: Bug #66439 [NEW]: Read from php://input on PUT request hanging
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183642@lists.php.net to get a copy of this message
From:             r dot westende at gmail dot com
Operating system: Windows Server 2008 R2
PHP version:      5.4.23
Package:          IIS related
Bug Type:         Bug
Bug description:Read from php://input on PUT request hanging

Description:
------------
When reading an HTTP PUT request's body from php://input PHP hangs.

The Windows Server 2008 R2 runs PHP 5.4.23 on IIS 7.5 using the
FastCgiModule.

Test script:
---------------
Dump the following PHP code in a file on a server.

<?php
	// Allow from any origin
    if (isset($_SERVER['HTTP_ORIGIN'])) {
        header("Access-Control-Allow-Origin:
{$_SERVER['HTTP_ORIGIN']}");
        header('Access-Control-Allow-Credentials: true');
        header('Access-Control-Max-Age: 86400');    // cache for 1 day
    }

    // Access-Control headers are received during OPTIONS requests
    if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {

        if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))
            header("Access-Control-Allow-Methods: PUT, GET, POST,
OPTIONS");         

        if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
            header("Access-Control-Allow-Headers:
{$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");

        exit(0);
    }

   $inpData = file_get_contents('php://input');
   
   echo($inpData);
   
   echo("Done");
?>

Then test using this JSFiddle and change the location of the PHP file it
PUTS vs POSTS to.

http://jsfiddle.net/piepkrak/bGGL2/

Expected result:
----------------
When running the test above, the result of a POST request will be
"testDone" without quotes. The result of a PUT request should be the
same.

Actual result:
--------------
A POST request results in the expected behavior. A PUT request should be
the same, but times out. It will display "timeout" without quotes.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=66439&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66439&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66439&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66439&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66439&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66439&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66439&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66439&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66439&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66439&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66439&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66439&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66439&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66439&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66439&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66439&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66439&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66439&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66439&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66439&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66439&r=mysqlcfg



Thread (1 message)

  • r dot westende at gmail dot com
« previous php.bugs (#183642) next »