mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-16 07:45:23 -04:00
set content length even if content-type is specified
svn:r324
This commit is contained in:
parent
ba748012ba
commit
9a65d0135f
13
http.c
13
http.c
@ -330,10 +330,13 @@ evhttp_make_header_response(struct evhttp_connection *evcon,
|
|||||||
evbuffer_add(evcon->output_buffer, line, strlen(line));
|
evbuffer_add(evcon->output_buffer, line, strlen(line));
|
||||||
|
|
||||||
/* Potentially add headers for unidentified content. */
|
/* Potentially add headers for unidentified content. */
|
||||||
if (EVBUFFER_LENGTH(req->output_buffer) &&
|
if (EVBUFFER_LENGTH(req->output_buffer)) {
|
||||||
evhttp_find_header(req->output_headers, "Content-Type") == NULL) {
|
if (evhttp_find_header(req->output_headers,
|
||||||
evhttp_add_header(req->output_headers,
|
"Content-Type") == NULL) {
|
||||||
"Content-Type", "text/html; charset=ISO-8859-1");
|
evhttp_add_header(req->output_headers,
|
||||||
|
"Content-Type", "text/html; charset=ISO-8859-1");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we need to add the content length if the user did
|
* we need to add the content length if the user did
|
||||||
* not give it, this is required for persistent
|
* not give it, this is required for persistent
|
||||||
@ -1752,7 +1755,7 @@ evhttp_parse_query(const char *uri, struct evkeyvalq *headers)
|
|||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
event_warnx("Got: %s -> %s\n", key, value);
|
event_debug(("Query Param: %s -> %s\n", key, value));
|
||||||
evhttp_add_header(headers, key, value);
|
evhttp_add_header(headers, key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user