Commit 30a9be8a authored by Andreas Jung's avatar Andreas Jung

Medusa called urllib.unquote() *before* calling crack_request().

If a request contained really quoted text crack_request() failed
with an exception because the correspondig regex is unable to handle
an unquoted request. unquot() is now called *after* crack_request
parent 837547b0
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# All Rights Reserved. # All Rights Reserved.
# #
RCS_ID = '$Id: http_server.py,v 1.22 2001/04/25 19:07:31 andreas Exp $' RCS_ID = '$Id: http_server.py,v 1.23 2001/04/30 14:38:40 andreas Exp $'
# python modules # python modules
import os import os
...@@ -454,12 +454,19 @@ class http_channel (asynchat.async_chat): ...@@ -454,12 +454,19 @@ class http_channel (asynchat.async_chat):
request = lines[0] request = lines[0]
command, uri, version = crack_request (request)
# unquote path if necessary (thanks to Skip Montaro for pointing # unquote path if necessary (thanks to Skip Montaro for pointing
# out that we must unquote in piecemeal fashion). # out that we must unquote in piecemeal fashion).
# ajung: unquote the request *after* calling crack_request because
# this function breaks when it gets an unquoted request
if '%' in request: if '%' in request:
request = unquote (request) request = unquote (request)
command, uri, version = crack_request (request)
header = join_headers (lines[1:]) header = join_headers (lines[1:])
r = http_request (self, request, command, uri, version, header) r = http_request (self, request, command, uri, version, header)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# All Rights Reserved. # All Rights Reserved.
# #
RCS_ID = '$Id: http_server.py,v 1.22 2001/04/25 19:07:31 andreas Exp $' RCS_ID = '$Id: http_server.py,v 1.23 2001/04/30 14:38:40 andreas Exp $'
# python modules # python modules
import os import os
...@@ -454,12 +454,19 @@ class http_channel (asynchat.async_chat): ...@@ -454,12 +454,19 @@ class http_channel (asynchat.async_chat):
request = lines[0] request = lines[0]
command, uri, version = crack_request (request)
# unquote path if necessary (thanks to Skip Montaro for pointing # unquote path if necessary (thanks to Skip Montaro for pointing
# out that we must unquote in piecemeal fashion). # out that we must unquote in piecemeal fashion).
# ajung: unquote the request *after* calling crack_request because
# this function breaks when it gets an unquoted request
if '%' in request: if '%' in request:
request = unquote (request) request = unquote (request)
command, uri, version = crack_request (request)
header = join_headers (lines[1:]) header = join_headers (lines[1:])
r = http_request (self, request, command, uri, version, header) r = http_request (self, request, command, uri, version, header)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment