From e526b3686a0a4254425d0e720cdcf6c2c45f82e1 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Mon, 6 Jun 2011 03:23:45 +1200 Subject: [PATCH] HTTP/1.1: Send 505 Unsupported Version on mangled version codes The top level parser is emitting HTTP status codes when it discovers malformed request line syntax. Pass the info on in the client response. At present only the unsuported-version code is available in HTTP. --- src/client_side.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client_side.cc b/src/client_side.cc index 6136fa8a20..bb874e05e2 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -2442,7 +2442,7 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c repContext->setReplyToError(ERR_UNSUP_REQ, HTTP_METHOD_NOT_ALLOWED, method, http->uri, conn->peer, NULL, conn->in.buf, NULL); break; default: - repContext->setReplyToError(ERR_INVALID_REQ, HTTP_BAD_REQUEST, method, http->uri, conn->peer, NULL, conn->in.buf, NULL); + repContext->setReplyToError(ERR_INVALID_REQ, hp->request_parse_status, method, http->uri, conn->peer, NULL, conn->in.buf, NULL); } assert(context->http->out.offset == 0); context->pullData(); -- 2.47.2