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

Parsing error when ws sub-protocol contains '.' characters. #1467

Closed
cjakeway opened this issue Dec 17, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@cjakeway
Copy link

commented Dec 17, 2018

Parsing of a web socket sub-protocol appears incorrect if the sub-protocol contains '.' characters. Example: "v2.bookings.example.net"

This is repeatable with libwebsockets 3.1.0.

See lib/roles/server-ws.c, within lws_process_ws_upgrade(), when selecting the protocol, the call to lws_tokenize_init() should probably be:

lws_tokenize_init(&ts, buf, LWS_TOKENIZE_F_COMMA_SEP_LIST | LWS_TOKENIZE_F_MINUS_NONTERM | LWS_TOKENIZE_F_DOT_NONTERM | LWS_TOKENIZE_F_RFC7230_DELIMS);

Cheers.

Chris

lws-team added a commit that referenced this issue Jan 5, 2019

@lws-team

This comment has been minimized.

Copy link
Member

commented Jan 5, 2019

Sorry this took a long time.... overload mode. It's pushed on master + v3.1-stable.

@lws-team lws-team closed this Jan 5, 2019

lws-team added a commit that referenced this issue Jan 5, 2019

@KhasanovRustam

This comment has been minimized.

Copy link

commented Jan 11, 2019

Does not work yet when a sub-protocol contains '.' characters.
The first lws_tokenize_init in the lws_process_ws_upgrade() function should also contain the LWS_TOKENIZE_F_RFC7230_DELIMS option, otherwise it hurts the whole buffer - treats the '.' as delimiters.

lws-team added a commit that referenced this issue Jan 12, 2019

@lws-team

This comment has been minimized.

Copy link
Member

commented Jan 12, 2019

Thanks... I pushed as you suggested on master.

lws-team added a commit that referenced this issue Jan 12, 2019

jpoornal-mcafee added a commit to opendxl-community/libwebsockets that referenced this issue Jun 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.