]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
HTTP/1.1: Send 505 Unsupported Version on mangled version codes
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 5 Jun 2011 15:23:45 +0000 (03:23 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 5 Jun 2011 15:23:45 +0000 (03:23 +1200)
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

index 6136fa8a205924bde145c90e4faf0ab80d597d66..bb874e05e2649edd82f14f02a510e616bb159426 100644 (file)
@@ -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();