Bug #72619 [Opn->Nab]: Support for custom HTTP methods not working

From: Date: Thu, 21 Jul 2016 14:12:17 +0000
Subject: Bug #72619 [Opn->Nab]: Support for custom HTTP methods not working
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202479@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72619&edit=1 ID: 72619 Updated by: cmb@php.net Reported by: nazar at mokrynskyi dot com Summary: Support for custom HTTP methods not working -Status: Open +Status: Not a bug Type: Bug Package: Built-in web server Operating System: Linux PHP Version: 7.0.8 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php In particular, read about the meaning of router scripts: | If a PHP file is given on the command line when the web server | is started it is treated as a "router" script. The script is run | at the start of each HTTP request. If this script returns FALSE, | then the requested resource is returned as-is. Otherwise the | script's output is returned to the browser. Previous Comments: ------------------------------------------------------------------------ [2016-07-19 04:56:25] nazar at mokrynskyi dot com Description: ------------ Similar to https://bugs.php.net/bug.php?id=61679, but with non-existing file path (handled by index.php). 1) > touch index.php 2) > php -S localhost:1234 index.php 3) Execute test script in another terminal Test script: --------------- <?php file_get_contents( 'http://localhost:1234/some-path', null, stream_context_create( [ 'http' => [ 'method' => 'PATCH' ] ] ) ); file_get_contents( 'http://localhost:1234/some-path', null, stream_context_create( [ 'http' => [ 'method' => 'XYZ_METHOD_ALSO_ALLOWED' ] ] ) ); Expected result: ---------------- Empty output both in test script and PHP server Actual result: -------------- Test script: PHP Warning: file_get_contents(http://localhost:1234/some-path): failed to open stream: HTTP request failed! HTTP/1.0 501 Not Implemented in %s/test.php on line 10 PHP Warning: file_get_contents(http://localhost:1234/some-path): failed to open stream: HTTP request failed! HTTP/1.0 501 Not Implemented in %s/test.php on line 21 PHP server: [%s] 127.0.0.1:%d [501]: /some-path - No such file or directory Note that PHP server doesn't print anything for PATCH method (for whatever reason, but it is a part of issue anyway). ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72619&edit=1

« previous php.bugs (#202479) next »