mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-27 04:09:31 +03:00
MHD_queue_response: check whether provided status code is a three digits code
This commit is contained in:
@@ -4234,6 +4234,17 @@ MHD_queue_response (struct MHD_Connection *connection,
|
||||
return MHD_NO;
|
||||
}
|
||||
#endif /* UPGRADE_SUPPORT */
|
||||
if ( (100 > (status_code & (~MHD_ICY_FLAG))) ||
|
||||
(999 < (status_code & (~MHD_ICY_FLAG))) )
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ ("Refused wrong status code (%u). " \
|
||||
"HTTP required three digits status code!\n"),
|
||||
(status_code & (~MHD_ICY_FLAG)));
|
||||
#endif
|
||||
return MHD_NO;
|
||||
}
|
||||
MHD_increment_response_rc (response);
|
||||
connection->response = response;
|
||||
connection->responseCode = status_code;
|
||||
|
||||
Reference in New Issue
Block a user