-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
When a path is in a connect url, should the request body include a trailing slash? #394
Comments
Example: let ws = WebSocket(url: URL(string: "ws://localhost:8080/test/?transport=websocket")!) |
It seems whether or not to have a trailing closure depends on the server configuration. However, this code doesn't seem to ever include a trailing / when given a path in the url. |
I personally have seen it both way. I tried to research some of the RFC specs to see what the right behavior was, but best I found was this:
https://tools.ietf.org/html/rfc2396#section-3.2 That seems to line up with my personal experience that it can be either way, but that all being said, changing it isn't difficult if we need. I would think we might want to dig deeper though, as it is doesn't seem to fall out side of the RFC and could be something else. Also I just tested adding |
Yeah I agree that this seems like something that should be looked into deeper. Unfortunately I can't update to 3.0 in one of my libs since node's WS server doesn't seem to like differing paths. But adding some config to Starscream to append a trailing slash also feels a bit tacked on. |
I checked in master what should hopefully be a simple fix. I figure it makes more sense to have Starscream make a simple change then try to make every server conform to the expected RFC. Might be a bit tacked on, but from what we found from #392, I'd think it is safer to keep the behavior the same as it use to be versus trying to track down issues with WebSocket servers. Let me know if that fixes it and I will do a 3.0.2 release. |
I can confirm that this works. |
I had to do a slightly different change as I noticed the fix I did broke the Autobahn test suite URLs. I updated the path creation to take exactly whatever the URL had it. Version 3.0.2 has been released and fixes this issue. |
@daltoniam I'm noticing that socket.io servers aren't picking up WebSockets transports from my socket.io-client. After doing some digging I've found that this bit of code does not add a trailing slash if the path is not empty. Is this valid, or is this something we should fix here, or do I need to dig around more?
The text was updated successfully, but these errors were encountered: