Ticket #2235: server_patch.txt

File server_patch.txt, 957 bytes (added by vincentk, 8 years ago)

patch consisting of the above unquote, as well as the removal of a nearby unused inner function

Line 
1Index: /Users/vincent/Documents/workspace/twisted/web2/server.py
2===================================================================
3--- /Users/vincent/Documents/workspace/twisted/web2/server.py   (revision 18611)
4+++ /Users/vincent/Documents/workspace/twisted/web2/server.py   (working copy)
5@@ -401,16 +401,10 @@
6                 "URL is not on this site (%s://%s/): %s" % (scheme, self.headers.getHeader("host"), url)
7             ))
8 
9-        segments = path.split("/")
10+        segments = unquote(path).split("/")
11         assert segments[0] == "", "URL path didn't begin with '/': %s" % (path,)
12         segments = segments[1:]
13 
14-        def notFound(f):
15-            f.trap(http.HTTPError)
16-            if f.response.code != responsecode.NOT_FOUND:
17-                raise f
18-            return None
19-
20         return defer.maybeDeferred(self._getChild, None, self.site.resource, segments, updatepaths=False)
21 
22     def _processingFailed(self, reason):