mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Feature: Allow OPTIONS on admin requests
This commit is contained in:
parent
2bd71b9d01
commit
0bb65ed090
14
src/admin.c
14
src/admin.c
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user