diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-03-07 21:27:58 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-03-07 21:29:41 +0300 |
commit | 56a7664a729419a08ae3223a48ef0fad1cca4369 (patch) | |
tree | 84a7801639819c6e7a65d90c948444929a1ff965 | |
parent | 406c434c722668687d7d752c8d2b6054d4340f3d (diff) | |
download | libmicrohttpd-56a7664a729419a08ae3223a48ef0fad1cca4369.tar.gz libmicrohttpd-56a7664a729419a08ae3223a48ef0fad1cca4369.zip |
reply: warn if manual "Content-Length" is used when this header is not allowed
-rw-r--r-- | src/microhttpd/connection.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 88b1f21d..def03b68 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -1833,6 +1833,15 @@ check_connection_reply (struct MHD_Connection *connection) | |||
1833 | "Non-empty response body is ignored and not used.\n"), | 1833 | "Non-empty response body is ignored and not used.\n"), |
1834 | (unsigned) (c->responseCode & (~MHD_ICY_FLAG))); | 1834 | (unsigned) (c->responseCode & (~MHD_ICY_FLAG))); |
1835 | } | 1835 | } |
1836 | if ( (! c->rp_props.use_reply_body_headers) && | ||
1837 | (0 != (r->flags_auto & MHD_RAF_HAS_CONTENT_LENGTH)) ) | ||
1838 | { | ||
1839 | MHD_DLOG (c->daemon, | ||
1840 | _ ("This reply with response code %u cannot use reply body. " | ||
1841 | "Application defined \"Content-Length\" header violates" | ||
1842 | "HTTP specification.\n"), | ||
1843 | (unsigned) (c->responseCode & (~MHD_ICY_FLAG))); | ||
1844 | } | ||
1836 | #else | 1845 | #else |
1837 | (void) c; /* Mute compiler warning */ | 1846 | (void) c; /* Mute compiler warning */ |
1838 | (void) r; /* Mute compiler warning */ | 1847 | (void) r; /* Mute compiler warning */ |