]> granicus.if.org Git - libevent/commitdiff
[Issue #313] set method to ASCII "NULL" if evhttp_method() returns NULL
authorMark Ellzey <ellzey@strcpy.net>
Sat, 25 Jun 2016 01:07:39 +0000 (18:07 -0700)
committerMark Ellzey <ellzey@strcpy.net>
Sat, 25 Jun 2016 01:07:39 +0000 (18:07 -0700)
http.c

diff --git a/http.c b/http.c
index 610d0f9c51930cb9ee55efc11cf8cd75f8d3a362..d3c79f8226920097e0292a785d90729027dbe046 100644 (file)
--- a/http.c
+++ b/http.c
@@ -435,7 +435,10 @@ evhttp_make_header_request(struct evhttp_connection *evcon,
        evhttp_remove_header(req->output_headers, "Proxy-Connection");
 
        /* Generate request line */
-       method = evhttp_method(req->type);
+       if (!(method = evhttp_method(req->type))) {
+               method = "NULL";
+       }
+
        evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
            "%s %s HTTP/%d.%d\r\n",
            method, req->uri, req->major, req->minor);