1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Feature: Allow OPTIONS on admin requests

This commit is contained in:
Philipp Schafft 2018-06-16 11:09:50 +00:00
parent 2bd71b9d01
commit 0bb65ed090
2 changed files with 14 additions and 10 deletions

View File

@ -540,7 +540,19 @@ void admin_handle_request(client_t *client, const char *uri)
format = handler->format;
}
handler->function(client, source, format);
switch (client->parser->req_type) {
case httpp_req_get:
handler->function(client, source, format);
break;
case httpp_req_options:
client_send_204(client);
break;
default:
ICECAST_LOG_ERROR("Wrong request type from client");
client_send_error_by_id(client, ICECAST_ERROR_CON_UNKNOWN_REQUEST);
break;
}
if (source) {
avl_tree_unlock(global.source_tree);
}

View File

@ -1162,15 +1162,7 @@ static void _handle_admin_request(client_t *client, char *adminuri)
stats_event_inc(NULL, "client_connections");
switch (client->parser->req_type) {
case httpp_req_get:
admin_handle_request(client, adminuri);
break;
default:
ICECAST_LOG_ERROR("Wrong request type from client");
client_send_error_by_id(client, ICECAST_ERROR_CON_UNKNOWN_REQUEST);
break;
}
admin_handle_request(client, adminuri);
}
/* Handle any client that passed the authing process.