1
0
Fork 0
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:
Joe Littlejohn 2018-03-07 20:23:49 +08:00 committed by Andy Green
parent fad43ff8e9
commit 6a925e5179

View file

@ -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);