mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 13:02:35 +00:00
HttpServer audio and thumbnail lookups explicitly only support GET -- I
think we were doing some unnecessary process with HEAD (and potentially OPTIONS) requests.
This commit is contained in:
parent
2f7fa348bf
commit
41f1020ac9
@ -318,10 +318,11 @@ int HttpServer::HandleRequest(
|
|||||||
int status = MHD_HTTP_NOT_FOUND;
|
int status = MHD_HTTP_NOT_FOUND;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (method && std::string(method) == "GET") {
|
||||||
if (!isAuthenticated(connection, server->context)) {
|
if (!isAuthenticated(connection, server->context)) {
|
||||||
status = 401; /* unauthorized */
|
status = 401; /* unauthorized */
|
||||||
static const char* error = "unauthorized";
|
static const char* error = "unauthorized";
|
||||||
response = MHD_create_response_from_buffer(strlen(error), (void*) error, MHD_RESPMEM_PERSISTENT);
|
response = MHD_create_response_from_buffer(strlen(error), (void*)error, MHD_RESPMEM_PERSISTENT);
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG
|
#ifdef ENABLE_DEBUG
|
||||||
std::cerr << "unauthorized\n";
|
std::cerr << "unauthorized\n";
|
||||||
@ -349,6 +350,7 @@ int HttpServer::HandleRequest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user