summaryrefslogtreecommitdiff
path: root/src/request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/request.c')
-rw-r--r--src/request.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/request.c b/src/request.c
index 236e1ce1..b38df938 100644
--- a/src/request.c
+++ b/src/request.c
@@ -619,11 +619,8 @@ static size_t http_request_parse_reqline(server *srv, connection *con, buffer *h
return http_request_header_line_invalid(srv, 400, "incomplete request line -> 400");
}
- *(uri - 1) = '\0';
- *(proto - 1) = '\0';
-
/* we got the first one :) */
- if (HTTP_METHOD_UNSET == (r = get_http_method_key(ptr))) {
+ if (HTTP_METHOD_UNSET == (r = get_http_method_key(ptr, uri - 1 - ptr))) {
return http_request_header_line_invalid(srv, 501, "unknown http-method -> 501");
}
@@ -674,6 +671,8 @@ static size_t http_request_parse_reqline(server *srv, connection *con, buffer *h
return http_request_header_line_invalid(srv, 400, "unknown protocol -> 400");
}
+ *(proto - 1) = '\0'; /*(terminate for strchr())*/
+
if (*uri == '/') {
/* (common case) */
buffer_copy_string_len(con->request.uri, uri, proto - uri - 1);