Message252080
I think the decision on how to parse the “path” attribute has to be left up to each request handler implementation, rather than being done blindly in BaseHTTPRequestHandler.parse_request(). The reason is there are various forms of HTTP request target that don’t actually have a path:
OPTIONS * # Asterisk form
OPTIONS http://example.net # Absolute form with no path nor query
CONNECT example.net:443 # Authority form
I agree that the current situation is far from ideal, and a function or method to parse a URL path should be very useful. Functions urlparse() and urlsplit() can already help with splitting off the query.
Currently there is double percent-decoding going on in the CGI server. “GET /cgi-bin/%2574est.py” decodes to “test.py”, when it should only decode as “%74est.py”. This is probably a side-effect of fixing Issue 14566 and related bugs.
Also, see Issue 5714 about making this function a public API. |
|
Date |
User |
Action |
Args |
2015-10-02 03:24:37 | martin.panter | set | recipients:
+ martin.panter, orsenthil, eric.araujo, v+python |
2015-10-02 03:24:37 | martin.panter | set | messageid: <1443756277.21.0.00645095007107.issue14567@psf.upfronthosting.co.za> |
2015-10-02 03:24:37 | martin.panter | link | issue14567 messages |
2015-10-02 03:24:36 | martin.panter | create | |
|