URL-parsing.

Johannes Grødem johs@c...
Thu, 3 May 2001 15:57:06 +0200


>> or do you mean that it doesn't work if the URI contains %20?
> I tried with %20, too, but it seems crack_request doesn't receive %20.
> The %20 is converted to a space before it reaches crack_request.

Ok, I haven't read the RFC thoroughly, but wouldn't this be the correct
way to do it?

--- http_server.py.old	Thu May 3 15:34:28 2001
+++ http_server.py	Thu May 3 15:34:45 2001
@@ -457,10 +457,10 @@

# unquote path if necessary (thanks to Skip Montaro for pointing
# out that we must unquote in piecemeal fashion).
-	if '%' in request:
-	request = unquote (request)

command, uri, version = crack_request (request)
+	if '%' in uri:
+	uri = unquote (uri)
header = join_headers (lines[1:])

r = http_request (self, request, command, uri, version, header)