[Zope3-checkins] CVS: Zope3/lib/python/Zope/Server/HTTP - HTTPRequestParser.py:1.3
Florent Guillaume
fg@nuxeo.com
Thu, 5 Dec 2002 04:42:06 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Server/HTTP
In directory cvs.zope.org:/tmp/cvs-serv30406/lib/python/Zope/Server/HTTP
Modified Files:
HTTPRequestParser.py
Log Message:
Fixed bug in uri parsing, where the query string was unquoted twice
(once by RequestParser and once by FieldStorage).
Added tests to check that unquoting is done correctly.
=== Zope3/lib/python/Zope/Server/HTTP/HTTPRequestParser.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/Server/HTTP/HTTPRequestParser.py:1.2 Mon Jun 10 19:29:35 2002
+++ Zope3/lib/python/Zope/Server/HTTP/HTTPRequestParser.py Thu Dec 5 04:42:05 2002
@@ -130,8 +130,6 @@
command, uri, version = self.crack_first_line()
self.command = str(command)
- if uri and '%' in uri:
- uri = unquote(uri)
self.uri = str(uri)
self.version = version
self.split_uri()
@@ -189,7 +187,10 @@
if m.end() != len(self.uri):
raise ValueError, "Broken URI"
else:
- self.path, query, self.fragment = m.groups()
+ path, query, self.fragment = m.groups()
+ if path and '%' in path:
+ path = unquote(path)
+ self.path = path
if query:
query = query[1:]
self.query = query