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:
parent
ede747f1bc
commit
0bfb172a9e
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue