mirror of https://git.48k.eu/ogserver
#915 returns 401 when incorrect authentication happens
ogAdmServer REST API now meets the starndar RFC 7235 when incorrect auth happens. og_client_not_authorized() now sends "401 Unauthorized" and "WWW-Authenticate" instead of 404.master
parent
9c7954b4cc
commit
66001f0a6c
|
@ -3929,7 +3929,9 @@ static int og_client_not_found(struct og_client *cli)
|
|||
|
||||
static int og_client_not_authorized(struct og_client *cli)
|
||||
{
|
||||
char buf[] = "HTTP/1.1 404 Unauthorized\r\nContent-Length: 0\r\n\r\n";
|
||||
char buf[] = "HTTP/1.1 401 Unauthorized\r\n"
|
||||
"WWW-Authenticate: Basic\r\n"
|
||||
"Content-Length: 0\r\n\r\n";
|
||||
|
||||
send(og_client_socket(cli), buf, strlen(buf), 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue