[TYRUS-434] Websocket client Origin header is missing scheme Created: 17/Oct/16  Updated: 26/Oct/16  Resolved: 26/Oct/16

Status: Resolved
Project: tyrus
Component/s: client
Affects Version/s: 1.13
Fix Version/s: 1.14, 2.0

Type: Bug Priority: Major
Reporter: KUKACharles Assignee: Pavel Bucek
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified



Connecting to certain WebSocket servers (in this case AutoBahn) gives a 400 response to the upgrade request because the "Origin" header of the request is malformed. A WireShark capture shows that the Origin header is missing the scheme, and correcting this issue by manually overriding the Origin header works around the issue.

Origin header as it appears now
Origin: localhost:12345

As it should appear
Origin: http://localhost:12345

Comment by patrik.sevallius [ 25/Oct/16 ]

I have the same issue with Tyrus when using Autobahn. Until Tyrus fixes it I'm using the following monkey-patch for Autobahn:

def _url_to_origin(url):
return 'null'

#monkey patch _url_to_origin in websocket.protocol
websocket.protocol._url_to_origin = _url_to_origin

Since my application don't care about origin.

Comment by Pavel Bucek [ 25/Oct/16 ]

Thanks for your report.

Fix is on the way.

Comment by Pavel Bucek [ 26/Oct/16 ]

fixed in 1.x and master branches.

Generated at Thu Oct 27 17:42:49 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.