mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-28 05:49:35 +00:00
HEAD request is not rejected
libmicrohttpd handles HEAD requests by dropping the body of the response (if any). Hence letting a HEAD request through into the code that processes GET requests is safe. Also added server unit-tests related to the handling of HEAD requests.
This commit is contained in:
@ -301,7 +301,8 @@ int InternalServer::handlerCallback(struct MHD_Connection* connection,
|
||||
}
|
||||
/* Unexpected method */
|
||||
if (request.get_method() != RequestMethod::GET
|
||||
&& request.get_method() != RequestMethod::POST) {
|
||||
&& request.get_method() != RequestMethod::POST
|
||||
&& request.get_method() != RequestMethod::HEAD) {
|
||||
printf("Reject request because of unhandled request method.\n");
|
||||
printf("----------------------\n");
|
||||
return MHD_NO;
|
||||
|
Reference in New Issue
Block a user