Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Capture processHandshake error #606

Closed
bbangert opened this issue Aug 17, 2016 · 1 comment
Closed

Capture processHandshake error #606

bbangert opened this issue Aug 17, 2016 · 1 comment
Assignees
Labels

Comments

@bbangert
Copy link
Member

processHandshake does not handle headers happily when a unicode error occurs. We should capture this better since our override calls the main one.

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position 9: ordinal not in range(128)
  File "autopush/websocket.py", line 111, in wrapper
    return func(self, *args, **kwargs)
  File "autopush/websocket.py", line 383, in processHandshake
    return self.parent_class.processHandshake(self)
  File "autobahn/websocket/protocol.py", line 2552, in processHandshake
    protocols = [str(x.strip()) for x in self.http_headers["sec-websocket-protocol"].split(",")]
@bbangert bbangert added this to the PUSHSVC-0: quality milestone Aug 17, 2016
@bbangert
Copy link
Member Author

And:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 93: ordinal not in range(128)
  File "autopush/websocket.py", line 111, in wrapper
    return func(self, *args, **kwargs)
  File "autopush/websocket.py", line 383, in processHandshake
    return self.parent_class.processHandshake(self)
  File "autobahn/websocket/protocol.py", line 2519, in processHandshake
    return self.failHandshake("HTTP Connection headers do not include 'upgrade' value (case-insensitive) : %s" % self.http_headers["connection"])
  File "autobahn/websocket/protocol.py", line 2861, in failHandshake
    self.sendHttpErrorResponse(code, reason, responseHeaders)
  File "autobahn/websocket/protocol.py", line 2868, in sendHttpErrorResponse
    response = "HTTP/1.1 {0} {1}\x0d\x0a".format(code, reason)

@bbangert bbangert self-assigned this Aug 18, 2016
bbangert added a commit that referenced this issue Aug 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants