php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74061 Built-in server assumes path with dot is a file
Submitted: 2017-02-08 14:06 UTC Modified: -
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: aljosha dot papsch at vinexus dot eu Assigned:
Status: Open Package: Built-in web server
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aljosha dot papsch at vinexus dot eu
New email:
PHP Version: OS:

 

 [2017-02-08 14:06 UTC] 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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-04 17:20 UTC] remi@php.net
Should have check for this bug..

So duplicate of #74205, fixed by https://github.com/php/php-src/pull/2403
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC