Bug #74061 [PATCH]: Built-in server assumes path with dot is a file
| From: | favatacharles@gmail.com | Date: | Mon, 20 Jul 2020 15:44:30 +0000 |
| Subject: | Bug #74061 [PATCH]: Built-in server assumes path with dot is a file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228131@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74061&edit=1
ID: 74061
Patch added by: favatacharles@gmail.com
Reported by: aljosha dot papsch at vinexus dot eu
Summary: Built-in server assumes path with dot is a file
Status: Open
Type: Bug
Package: Built-in web server
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Update .travis.yml to include PHP 7.2-7.4
On GitHub: https://github.com/php/pecl-mail-mailparse/pull/9
Patch: https://github.com/php/pecl-mail-mailparse/pull/9.patch
Previous Comments:
------------------------------------------------------------------------
[2017-03-04 17:20:57] remi@php.net
Should have check for this bug..
So duplicate of #74205, fixed by https://github.com/php/php-src/pull/2403
------------------------------------------------------------------------
[2017-03-04 17:14:32] requinix@php.net
Related To: Bug #74205
------------------------------------------------------------------------
[2017-02-08 14:06:09] aljosha dot papsch at vinexus dot eu
Description:
------------
If the path contains a dot, built-in server assumes it's a file and tries to serve it. Try the
test script with the following URLs. Last one will return 404 response but should route to
index.php.
$ curl http://localhost:8000/
$ curl http://localhost:8000/O_o
$ curl http://localhost:8000/O.o
Test script:
---------------
<?php
echo "hello, world\n";
Expected result:
----------------
hello, world
Actual result:
--------------
<!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">/ba.z</code> was not found on this
server.</p></body></html>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74061&edit=1