src: make Sec-WebSocket-Key check case-insensitive#7248
src: make Sec-WebSocket-Key check case-insensitive#7248MylesBorins merged 1 commit intonodejs:masterfrom
Conversation
src/inspector_socket.cc
Outdated
There was a problem hiding this comment.
You may want to keep the arguments aligned here :-)
There was a problem hiding this comment.
fixed. Needing to put things on a new line as the sizeof line was spilling over 80 characters
There was a problem hiding this comment.
Sorry to be so nit-picky, but ideally the subsequent arguments of strncasecmp should start at the same column at which the first one does (basically like they were before)
There was a problem hiding this comment.
got it this time I think :P
9d97d5b to
f3baec9
Compare
|
LGTM pending @addaleax's comment. |
f3baec9 to
9611926
Compare
src/inspector_socket.cc
Outdated
There was a problem hiding this comment.
Can you add a version of StringEqualNoCase() that takes a size parameter and use that?
Style: arguments should line up here.
There was a problem hiding this comment.
lining up the arguments pushes over 80 characters... what is the best way to deal with that?
edit: nvm got the line up... looking into StringEqualNoCase
9611926 to
8ee040e
Compare
|
lgtm |
8ee040e to
ffb8530
Compare
|
updated based on @bnoordhuis' suggestions. PTAL |
|
@thealphanerd now that you have added |
ffb8530 to
f7269c7
Compare
|
@ofrobots updated with test. Let me know if you would like some more cases |
f7269c7 to
071889c
Compare
src/util-inl.h
Outdated
There was a problem hiding this comment.
I think we are guaranteed at this point that if a[i] is null, then b[i] is also null. I think you can simply return true if a[i] is null. The second if below can simply be dropped.
It would be good to add a test that compares: "abc\0abc" and "abc\0xyz". Your function should (already does) return true for this. This matches the semantics of strncmp.
|
LGTM w/ comment. |
071889c to
493e0ce
Compare
|
Updated to address @ofrobots comments. PTAL edit: |
493e0ce to
263d9ef
Compare
src/inspector_socket.cc
Outdated
263d9ef to
ec6604a
Compare
|
Updated based on @bnoordhuis's suggestions PTAL |
src/util-inl.h
Outdated
|
LGTM with comment. |
ec6604a to
f5c8dc6
Compare
|
updated PTAL |
|
If there are no other concerns with this PR I will merge it tomorrow morning |
f5c8dc6 to
02fd124
Compare
Current case sensitive comparison is breaking netty-based WS clients. replace strncmp with strncasecmp Fixes: nodejs#7247 PR-URL: nodejs#7248 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
02fd124 to
f1d1071
Compare
Current case sensitive comparison is breaking netty-based WS clients. replace strncmp with strncasecmp Fixes: #7247 PR-URL: #7248 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Checklist
make -j4 test(UNIX) orvcbuild test nosign(Windows) passesAffected core subsystem(s)
src
Description of change
Current case sensitive comparison is breaking netty-based WS clients.
replace strncmp with strncasecmp
Fixes: #7247