thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 426 forks source link

Websockets broken due to bug in Qt Webkit #335

Closed iblue closed 12 years ago

iblue commented 12 years ago

The implementation of WebSockets in Qt (used by capybara-webkit seems to be buggy). It still uses an old draft of the WebSocket implementation that seems to be completely broken.

Reproducing the bug

In order to reproduce the bug, please see https://github.com/iblue/capybara-webkit-websocket-bug.

Details

The probleme here is, that it sends a WebSocket-Protocol header instead of the expected RFC 6455 Sec-WebSocket-Protocol header. It also terminates the connection, if does not receive the same headers as sent, which is even incorrect according to the drafts I found.

A possible solution would be upgrading to a more recent version of Qt Webkit. But I am not sure how all the internals of capybara-webkit work, so I will just give you this bug report.

To examine the details, please take a look in the files in https://github.com/iblue/capybara-webkit-websocket-bug and https://bugs.webkit.org/show_bug.cgi?id=85737

Any information on how to solve this myself are greatly appreciated.

xiy commented 12 years ago

I assume this will work correctly with Qt 4.8?

iblue commented 12 years ago

I eventually had the time to take a look at the Qt 4.8.1 sourcecode. I've not tested it, but it looks like the websocket is RFC-compatible. At least it sends the Sec-WebSocket-Protocol headers.

xiy commented 12 years ago

I'll add this to my todo for 4.8 compatibility then. Hopefully I can get started on the failing specs first and then move onto this.

jferris commented 12 years ago

I'm closing this, since it's a bug in QtWebKit and it seems to be fixed in the latest version.