1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

http: basic auth: fix delay on Firefox

Firefox sends HTTP requests with "Connection: keep-alive" header.
When LWS responds with 401 and WWW-Authenticate header, Firefox
doesn't show an authentication dialog until connection is closed.
Adding "Content-Length: 0" solves the problem.
This commit is contained in:
pavelxdd 2019-04-03 10:18:17 +03:00 committed by Andy Green
parent ede747f1bc
commit 0bfb172a9e

View file

@ -829,6 +829,9 @@ lws_unauthorised_basic_auth(struct lws *wsi)
(unsigned char *)buf, n, &p, end))
return -1;
if (lws_add_http_header_content_length(wsi, 0, &p, end))
return -1;
if (lws_finalize_http_header(wsi, &p, end))
return -1;