Bug #72619 [NEW]: Support for custom HTTP methods not working

From: Date: Tue, 19 Jul 2016 04:56:29 +0000
Subject: Bug #72619 [NEW]: Support for custom HTTP methods not working
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202411@lists.php.net to get a copy of this message
From:             nazar at mokrynskyi dot com
Operating system: Linux
PHP version:      7.0.8
Package:          Built-in web server
Bug Type:         Bug
Bug description:Support for custom HTTP methods not working

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



Thread (4 messages)

« previous php.bugs (#202411) next »