aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/response.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-10-05 19:23:26 +0200
committerChristian Grothoff <christian@grothoff.org>2018-10-05 19:23:26 +0200
commit0db81a9248b12abc74f153ebd642441d0f9c3e58 (patch)
tree01406d248d24a802445824ffda019200ce203ab2 /src/microhttpd/response.c
parentbc8e12c8379d7bf1d99bf67260bcefadd77852a8 (diff)
downloadlibmicrohttpd-0db81a9248b12abc74f153ebd642441d0f9c3e58.tar.gz
libmicrohttpd-0db81a9248b12abc74f153ebd642441d0f9c3e58.zip
fix #5411
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r--src/microhttpd/response.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 9de4843d..d7835c20 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -119,6 +119,27 @@ MHD_add_response_header (struct MHD_Response *response,
119 const char *header, 119 const char *header,
120 const char *content) 120 const char *content)
121{ 121{
122 if ( (MHD_str_equal_caseless_ (header,
123 MHD_HTTP_HEADER_TRANSFER_ENCODING)) &&
124 (! MHD_str_equal_caseless_ (content,
125 "identity")) &&
126 (! MHD_str_equal_caseless_ (content,
127 "chunked")) )
128 {
129 /* Setting transfer encodings other than "identity" or
130 "chunked" is not allowed. Note that MHD will set the
131 correct transfer encoding if required automatically. */
132 /* NOTE: for compressed bodies, use the "Content-encoding" header */
133 return MHD_NO;
134 }
135 if (MHD_str_equal_caseless_ (header,
136 MHD_HTTP_HEADER_CONTENT_LENGTH))
137 {
138 /* MHD will set Content-length if allowed and possible,
139 reject attempt by application */
140 return MHD_NO;
141 }
142
122 return add_response_entry (response, 143 return add_response_entry (response,
123 MHD_HEADER_KIND, 144 MHD_HEADER_KIND,
124 header, 145 header,