[php-src] Issue #15597: PHP Built-in web server returns 405 on PATCH/PUT if path contains the dot (.) character
| From: | callmewind | Date: | Tue, 27 Aug 2024 10:56:12 +0000 |
| Subject: | [php-src] Issue #15597: PHP Built-in web server returns 405 on PATCH/PUT if path contains the dot (.) character | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247605@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15597
Author: callmewind
### Description
The following code:
```bash
# touch index.php
# php -S localhost:8000
# curl localhost:8000/foo.bar -i -X PUT
```
Resulted in this output:
```
HTTP/1.1 405 Method Not Allowed
Host: localhost:8000
Date: Tue, 27 Aug 2024 10:52:07 GMT
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 501
Allow: GET, HEAD, POST
<!doctype html><html><head><title>405 Method Not
Allowed</title><style>
body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }
h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em;
line-height:2em; border-bottom: 1px inset black; margin: 0; }
h1, p { padding-left: 10px; }
code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}
</style>
</head><body><h1>Method Not Allowed</h1><p>Requested method not
allowed.</p></body></html>
```
But I expected this output instead:
```
HTTP/1.1 404 Not Found
Host: localhost:8000
Date: Tue, 27 Aug 2024 10:53:27 GMT
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 540
<!doctype html><html><head><title>404 Not Found</title><style>
body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }
h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em;
line-height:2em; border-bottom: 1px inset black; margin: 0; }
h1, p { padding-left: 10px; }
code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}
</style>
</head><body><h1>Not Found</h1><p>The requested resource <code
class="url">/foo.bar</code> was not found on this
server.</p></body></html>
```
A 404 is returned on POST and GET requests
### PHP Version
PHP 8.3.6
### Operating System
_No response_