http server fix

This commit is contained in:
2024-11-25 15:00:42 +03:00
parent 1acaf24df9
commit 58b3fa64bc
2 changed files with 8 additions and 6 deletions

View File

@@ -88,7 +88,7 @@ bool MicrohttpdServerConnection::ready() {
return true;
}
}
// piCout << "ready" << (int)method << path;
// piCout << "ready" << (int)method << path << body.size();
MessageMutable req;
req.setMethod(method);
req.setPath(path);
@@ -242,15 +242,16 @@ int answer_callback(void * cls,
conn->method = m;
MHD_get_connection_values(connection, MHD_HEADER_KIND, (MHD_KeyValueIterator)header_iterate, *con_cls);
MHD_get_connection_values(connection, MHD_GET_ARGUMENT_KIND, (MHD_KeyValueIterator)args_iterate, *con_cls);
if (server->isBasicAuthEnabled() && !conn->authorized) {
if (!conn->checkBasicAuth()) return MHD_YES;
}
return MHD_YES;
}
if (m == Method::Unknown) {
return conn->sendReply(MessageMutable::fromCode(Code::MethodNotAllowed));
}
if (server->isBasicAuthEnabled() && !conn->authorized) {
if (!conn->checkBasicAuth()) return MHD_YES;
}
if (*upload_data_size) {
if (!conn->postprocessor) {