Skip to content
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

Pass throught custom http headers as transport configuration #1630

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion autobahn/wamp/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _create_transport(index, transport, check_native_endpoint=None):
'options must be a dict, not {}'.format(type(options))
)

headers = transport.get("headers", None)
headers = transport.get("headers")

if kind == 'websocket':
for key in ['url']:
Expand Down Expand Up @@ -229,6 +229,8 @@ def _create_transport(index, transport, check_native_endpoint=None):
endpoint_config = transport['endpoint']
if 'serializers' in transport:
raise ValueError("'serializers' is only for websocket; use 'serializer'")
if headers is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not None I think..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh man...
thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed

raise ValueError("'headers' not supported for rawsocket transport")
# always a list; len == 1 for rawsocket
if 'serializer' in transport:
if not isinstance(transport['serializer'], (str, str)):
Expand Down
Loading