PerfectlySoft / Perfect

Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
https://www.perfect.org
Apache License 2.0
13.83k stars 945 forks source link

FireFox can't connect to Perfect WebSocket Server. #146

Closed wuqiong closed 8 years ago

wuqiong commented 8 years ago

FireFox can't connect to Perfect WebSocket Server. Tested Firefox Version is 45.0.1, other version might be the same. Because Firefox send the request with Connection header keep-alive, Upgrade, not as the WebSocketHandler.swift #292 line exactly checked Upgrade.

where upgrade.lowercaseString == "websocket" && connection.lowercaseString == "upgrade" else {
... ...

But, The RFC-6455 spec, Section 4.1 states ...

  1. The request MUST contain a |Connection| header field whose value MUST include the "Upgrade" token.

which means that multi-value Connection header is legitimate and needs to be handled properly. so, FireFox actions right.

kjessup commented 8 years ago

Thank you! I'm going to target fixing this for 1.1 and will backport it to a new 1.0.1 branch. I'll close this when completed.