[Issue #313] set method to ASCII "NULL" if evhttp_method() returns NULL

This commit is contained in:
Mark Ellzey 2016-06-24 18:07:39 -07:00
parent a69e4fadca
commit 17cc636223
No known key found for this signature in database
GPG Key ID: F20A5EBD06A5B6C2

5
http.c
View File

@ -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);