Fix return 403 status code

pull/2675/head
Isaac Connor 2019-07-26 12:22:04 -04:00
parent 09934ed7f5
commit e5c194e9ee
1 changed files with 4 additions and 4 deletions

View File

@ -211,17 +211,17 @@ int main(int argc, const char *argv[]) {
}
}
if ( !user ) {
fputs("HTTP/1.0 401 Unauthorized\r\n", stdout);
fputs("HTTP/1.0 403 Forbidden\r\n\r\n", stdout);
Error("Unable to authenticate user");
logTerm();
zmDbClose();
return -1;
return 0;
}
if ( !ValidateAccess(user, monitor_id) ) {
fputs("HTTP/1.0 403 Forbidden\r\n", stdout);
fputs("HTTP/1.0 403 Forbidden\r\n\r\n", stdout);
logTerm();
zmDbClose();
return -1;
return 0;
}
} // end if config.opt_use_auth