diff options
Diffstat (limited to 'libpathod/pathod.py')
-rw-r--r-- | libpathod/pathod.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libpathod/pathod.py b/libpathod/pathod.py index 2e93a330..dbcb807d 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -201,11 +201,12 @@ class PathodHandler(tcp.BaseHandler): self.addlog(retlog) return again - if not self.server.nocraft and path.startswith(self.server.craftanchor): + if not self.server.nocraft and utils.matchpath(path, self.server.craftanchor): + spec = urllib.unquote(path)[len(self.server.craftanchor) + 1:] key = websockets.check_client_handshake(headers) - if key: - self.settings.websocket_key = key - spec = urllib.unquote(path)[len(self.server.craftanchor):] + self.settings.websocket_key = key + if key and not spec: + spec = "ws" self.info("crafting spec: %s" % spec) try: crafted = language.parse_response(spec) @@ -301,7 +302,7 @@ class Pathod(tcp.TCPServer): addr, ssl=False, ssloptions=None, - craftanchor="/p/", + craftanchor="/p", staticdir=None, anchors=(), sizelimit=None, |