mirror of
https://github.com/lammertb/libhttp.git
synced 2025-08-09 03:22:45 +03:00
Do authentication before trying NEW_REQUEST callback.
This commit is contained in:
parent
a9b6eb1809
commit
a57f2cf744
@@ -3227,10 +3227,10 @@ static void handle_request(struct mg_connection *conn) {
|
|||||||
convert_uri_to_file_name(conn, ri->uri, path, sizeof(path));
|
convert_uri_to_file_name(conn, ri->uri, path, sizeof(path));
|
||||||
|
|
||||||
DEBUG_TRACE(("%s", ri->uri));
|
DEBUG_TRACE(("%s", ri->uri));
|
||||||
if (call_user(conn, MG_NEW_REQUEST) != NULL) {
|
if (!check_authorization(conn, path)) {
|
||||||
// Do nothing, callback has served the request
|
|
||||||
} else if (!check_authorization(conn, path)) {
|
|
||||||
send_authorization_request(conn);
|
send_authorization_request(conn);
|
||||||
|
} else if (call_user(conn, MG_NEW_REQUEST) != NULL) {
|
||||||
|
// Do nothing, callback has served the request
|
||||||
} else if (strstr(path, PASSWORDS_FILE_NAME)) {
|
} else if (strstr(path, PASSWORDS_FILE_NAME)) {
|
||||||
// Do not allow to view passwords files
|
// Do not allow to view passwords files
|
||||||
send_http_error(conn, 403, "Forbidden", "Access Forbidden");
|
send_http_error(conn, 403, "Forbidden", "Access Forbidden");
|
||||||
|
Reference in New Issue
Block a user