Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server not handling "Upgrade" header case-insensitively, as it should #13

Closed
ysangkok opened this issue Nov 27, 2011 · 6 comments
Closed

Comments

@ysangkok
Copy link

According to the standard draft 10 that the README says this server conforms to, the Upgrade header should be handled case-insensitively. Currently it is handled case-sensitively.

middleware.py:

def __call__(self, environ, start_response):
    # Initial handshake validation
    try:
        if 'websocket' not in environ.get('upgrade.protocol', ''):
            raise HandshakeError("Upgrade protocol is not websocket")
@ysangkok
Copy link
Author

The problem is still there, in cherrypyserver.py:125. I can't reopen. Should I make a new issue?

@Lawouach
Copy link
Owner

Have you tried? IIRC CherryPy header's dict is case insensitive so it doesn't need to be explicitly transformed.

@ysangkok
Copy link
Author

Yes, I tried. The reason I didn't catch it earlier is that I modified the client library. Now that I'm running with the original client library (AutobahnAndroid), the problem appears. I'm pretty sure the case-insensitivity only applies to the keys. If it didn't, base64 would break.

@Lawouach
Copy link
Owner

Right. I think I went too fast this morning. You're quite right and i'll be looking at it as soon as I get a new computer to replace my dead one :p

@ysangkok
Copy link
Author

I'm in no rush, but did you get that new computer yet?

@Lawouach
Copy link
Owner

Lawouach commented Feb 5, 2012

Hopefully this should be taken care of now. I need to find an easy way to unit tests the tool properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants