Commit 0bb65ed0 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Allow OPTIONS on admin requests

parent 2bd71b9d
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment