mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-17 01:20:04 -04:00
Make 401 persistent. Not convinced this is right
This commit is contained in:
parent
0df8292d6f
commit
e3b5c496bc
@ -734,7 +734,11 @@ void *ws_dispatcher(void *arg) {
|
|||||||
pwsc->threadno);
|
pwsc->threadno);
|
||||||
|
|
||||||
can_dispatch=0;
|
can_dispatch=0;
|
||||||
if(auth_handler) {
|
/* If an auth handler is registered, but it accepts a
|
||||||
|
* username and password of NULL, then don't bother
|
||||||
|
* authing.
|
||||||
|
*/
|
||||||
|
if((auth_handler) && (auth_handler(NULL,NULL)==0)) {
|
||||||
/* do the auth thing */
|
/* do the auth thing */
|
||||||
auth=ws_getarg(&pwsc->request_headers,"Authorization");
|
auth=ws_getarg(&pwsc->request_headers,"Authorization");
|
||||||
if(auth) {
|
if(auth) {
|
||||||
@ -749,16 +753,19 @@ void *ws_dispatcher(void *arg) {
|
|||||||
ws_addarg(&pwsc->response_headers,"Connection","close");
|
ws_addarg(&pwsc->response_headers,"Connection","close");
|
||||||
ws_addarg(&pwsc->response_headers,"WWW-Authenticate",
|
ws_addarg(&pwsc->response_headers,"WWW-Authenticate",
|
||||||
"Basic realm=\"webserver\"");
|
"Basic realm=\"webserver\"");
|
||||||
pwsc->close=1;
|
|
||||||
ws_returnerror(pwsc,401,"Unauthorized");
|
ws_returnerror(pwsc,401,"Unauthorized");
|
||||||
ws_close(pwsc);
|
pwsc->error=0;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
can_dispatch=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(can_dispatch) {
|
||||||
|
if(req_handler)
|
||||||
|
req_handler(pwsc);
|
||||||
|
else
|
||||||
|
ws_defaulthandler(pwsp,pwsc);
|
||||||
}
|
}
|
||||||
if(req_handler)
|
|
||||||
req_handler(pwsc);
|
|
||||||
else
|
|
||||||
ws_defaulthandler(pwsp,pwsc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((pwsc->close) || (pwsc->error) || (pwsp->stop)) {
|
if((pwsc->close) || (pwsc->error) || (pwsp->stop)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user