]> granicus.if.org Git - libevent/commitdiff
set content length even if content-type is specified
authorNiels Provos <provos@gmail.com>
Sun, 11 Feb 2007 07:58:39 +0000 (07:58 +0000)
committerNiels Provos <provos@gmail.com>
Sun, 11 Feb 2007 07:58:39 +0000 (07:58 +0000)
svn:r324

http.c

diff --git a/http.c b/http.c
index 62ab505db0d18741e4b16673631aff2e65cc3a65..0d4b44d56fc32c02c186718e6beb187038046163 100644 (file)
--- a/http.c
+++ b/http.c
@@ -330,10 +330,13 @@ evhttp_make_header_response(struct evhttp_connection *evcon,
        evbuffer_add(evcon->output_buffer, line, strlen(line));
 
        /* Potentially add headers for unidentified content. */
-       if (EVBUFFER_LENGTH(req->output_buffer) &&
-           evhttp_find_header(req->output_headers, "Content-Type") == NULL) {
-               evhttp_add_header(req->output_headers,
-                   "Content-Type", "text/html; charset=ISO-8859-1");
+       if (EVBUFFER_LENGTH(req->output_buffer)) {
+               if (evhttp_find_header(req->output_headers,
+                       "Content-Type") == NULL) {
+                       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
                 * not give it, this is required for persistent
@@ -1752,7 +1755,7 @@ evhttp_parse_query(const char *uri, struct evkeyvalq *headers)
                if (value == NULL)
                        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);
        }