Bug #76204 [Com]: CONNECT method doesn't work
| From: | sid dot pasquale at gmail dot com | Date: | Tue, 10 Apr 2018 16:14:44 +0000 |
| Subject: | Bug #76204 [Com]: CONNECT method doesn't work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214683@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76204&edit=1
ID: 76204
Comment by: sid dot pasquale at gmail dot com
Reported by: sid dot pasquale at gmail dot com
Summary: CONNECT method doesn't work
Status: Duplicate
Type: Bug
Package: Built-in web server
Operating System: linux
PHP Version: 7.0.29
Block user comment: N
Private report: N
New Comment:
So the expected result should be "501 Not Implemented".
Furthermore "CONNECT" (like PATCH) seems to be implemented:
https://github.com/php/php-src/search?utf8=%E2%9C%93&q=PHP_HTTP_CONNECT&type=
Working "PATCH" example:
sid@zen:~$ echo -en "PATCH / HTTP/1.1\r\n\r\n" | nc localhost 8080 | head -n 1
HTTP/1.1 404 Not Found
Previous Comments:
------------------------------------------------------------------------
[2018-04-10 16:05:05] requinix@php.net
CONNECT is not supported because the built-in server is a simple server for simple development uses.
See request #72619.
------------------------------------------------------------------------
[2018-04-10 15:59:15] sid dot pasquale at gmail dot com
Description:
------------
PHP HTTP built-in server doesn't support CONNECT HTTP method
Test script:
---------------
Starting built-in server:
sid@zen:~$ php -S 127.0.0.1:8080
Test with some working HTTP methods:
sid@zen:~$ echo -en "GET / HTTP/1.1\r\n\r\n" | nc localhost 8080 | head -n 1
HTTP/1.1 404 Not Found
sid@zen:~$ echo -en "FOO / HTTP/1.1\r\n\r\n" | nc localhost 8080 | head -n 1
HTTP/1.1 501 Not Implemented
Not working:
sid@zen:~$ echo -en "CONNECT www.example.com:443 HTTP/1.1\r\n\r\n" | nc localhost 8080 |
head -n 1
Actual result:
--------------
[Tue Apr 10 17:51:27 2018] 127.0.0.1:44676 Invalid request (Malformed HTTP request)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76204&edit=1