do not include content-length with chunked
As reported by - content-length should not be added if the
content-type is chunked.
@@ -995,6 +995,7 @@ htp__path_new_(evhtp_path_t ** out, const char * data, size_t len)
if (req_path == NULL) {
return -1;
}
+
#endif
*out = NULL;
@@ -1118,7 +1119,6 @@ error:
return -1;
} /* htp__path_new_ */
-
/**
* @brief create an authority structure
*
@@ -2083,7 +2083,9 @@ check_proto:
evhtp_header_new("Connection", "close", 0, 0));
}
- if (!evhtp_header_find(request->headers_out, "Content-Length")) {
+ if (!evhtp_header_find(request->headers_out, "Content-Length") &&
+ /* cannot have both chunked and content-length */
+ !(request->flags & EVHTP_REQ_FLAG_CHUNKED)) {
evhtp_headers_add_header(request->headers_out,
evhtp_header_new("Content-Length", "0", 0, 0));
}
@@ -4156,6 +4158,7 @@ evhtp_callback_new(const char * path, evhtp_callback_type type, evhtp_callback_c
return NULL;
}
+
break;
#ifndef EVHTP_DISABLE_REGEX
case evhtp_callback_type_regex:
