paste httpserver discards fragments for

0 views
Skip to first unread message

Martin Wendt

unread,
Jul 11, 2009, 2:23:54 AM7/11/09
to Paste Users
Hi,

I recently picked up the Ho Cun Wei's work on PyFileServer (a WSGI
WebDAV server) and tried replace the existing standalone server with
paste.httpserver.
The litmus test emits a warning, because now the server accepts a
DELETE request on /a/b/c#frag to delete a resource that is mapped on /
a/b/c.

Seems that the fragment part of the URL is silently discarded, when
constructing PATH_INFO:

paste.httpserver
def wsgi_setup(self, environ=None):
"""
Setup the member variables used by this WSGI mixin,
including
the ``environ`` and status member variables.

After the basic environment is created; the optional
``environ``
argument can be used to override any settings.
"""

(scheme, netloc, path, query, fragment) = urlparse.urlsplit
(self.path)
path = urllib.unquote(path)
[...]

<path> is then used to set up PATH_INFO

Is this the correct behaviour (I didn't find it in the PEP)?
Otherwise I suggest to patch it like this:
(scheme, netloc, path, query, fragment) = urlparse.urlsplit
(self.path, allow_fragments=False)

Regards
Martin
Reply all
Reply to author
Forward
0 new messages