mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Add 'HS: ws upgrade unauthorized' on receiving 401
In the case that the connection cannot be established because the caller is unauthorized, it's likely they have to do something to gain authorization before retrying. This change introduces a new message that can be checked for to understand more about why the connection has failed to establish. Closes #1200
This commit is contained in:
parent
fad43ff8e9
commit
6a925e5179
1 changed files with 7 additions and 0 deletions
|
@ -728,6 +728,13 @@ lws_client_interpret_server_handshake(struct lws *wsi)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (p && !strncmp(p, "401", 3)) {
|
||||
lwsl_warn(
|
||||
"lws_client_handshake: got bad HTTP response '%s'\n", p);
|
||||
cce = "HS: ws upgrade unauthorized";
|
||||
goto bail3;
|
||||
}
|
||||
|
||||
if (p && strncmp(p, "101", 3)) {
|
||||
lwsl_warn(
|
||||
"lws_client_handshake: got bad HTTP response '%s'\n", p);
|
||||
|
|
Loading…
Add table
Reference in a new issue