Open rdbhost opened 9 years ago
Hi David,
Thanks for the patch. I've commented it but it looks good and will probably be merged.
Cheers,
2014-12-12 6:57 GMT+01:00 David Keeney notifications@github.com:
It is sometimes useful to be able to set a custom Origin header.
There is a 'headers' parameter to the client constructor (threaded client), where you can provide a new Origin header, but it is appended to the headers which already have an Origin value. Servers ignore duplicate Origin values.
I suggest changing the header code to allow the default Origin header to be overwritten by an Origin entry in the headers parameter.
Also, in the absence of an over-riding Origin header, the default should be schema://host[:port] per rfc 6454, not the full url.
I can provide a patch if you wish.
— Reply to this email directly or view it on GitHub https://github.com/Lawouach/WebSocket-for-Python/issues/153.
Is this still an issue? I see this: https://github.com/Lawouach/WebSocket-for-Python/blob/master/ws4py/client/__init__.py#L261
Looks like if the user sets the origin header the client won't add another?
Good catch.
Is this an issue in the 0.3.4 release (the version currently on PyPI)? If so, would it be possible for the PyPI version to be updated?
It is sometimes useful to be able to set a custom Origin header.
There is a 'headers' parameter to the client constructor (threaded client), where you can provide a new Origin header, but it is appended to the headers which already have an Origin value. Servers ignore duplicate Origin values.
I suggest changing the header code to allow the default Origin header to be overwritten by an Origin entry in the headers parameter.
Also, in the absence of an over-riding Origin header, the default should be schema://host[:port] per rfc 6454, not the full url.
I can provide a patch if you wish.