]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Update status code 413 compliance (#1040)
authorAmos Jeffries <yadij@users.noreply.github.com>
Mon, 9 May 2022 19:58:26 +0000 (19:58 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 9 May 2022 19:58:35 +0000 (19:58 +0000)
The latest HTTP specification requires the data
transmitted in HTTP messages be called 'content'.

The official reason text for status code 413 has
been altered to comply.

src/client_side.cc
src/http.cc
src/http/StatusCode.cc
src/http/StatusCode.h

index 16dc4b449d25d2120e8e980f685937c506e0a2fc..a1c683e6d08962c2d6e113be1f76149846482581 100644 (file)
@@ -1713,7 +1713,7 @@ clientProcessRequest(ConnStateData *conn, const Http1::RequestParserPointer &hp,
             assert (repContext);
             conn->quitAfterError(request.getRaw());
             repContext->setReplyToError(ERR_TOO_BIG,
-                                        Http::scPayloadTooLarge, nullptr,
+                                        Http::scContentTooLarge, nullptr,
                                         conn, http->request, nullptr, nullptr);
             assert(context->http->out.offset == 0);
             context->pullData();
@@ -2098,7 +2098,7 @@ ConnStateData::abortChunkedRequestBody(const err_type error)
         clientReplyContext *repContext = dynamic_cast<clientReplyContext*>(node->data.getRaw());
         assert(repContext);
         const Http::StatusCode scode = (error == ERR_TOO_BIG) ?
-                                       Http::scPayloadTooLarge : HTTP_BAD_REQUEST;
+                                       Http::scContentTooLarge : HTTP_BAD_REQUEST;
         repContext->setReplyToError(error, scode,
                                     repContext->http->uri,
                                     CachePeer,
index b8a5072fea5e263203b575ce67dd26abb8b9bc64..a7a70ffc505b87f8c42d0b20c597c802df9a4fd1 100644 (file)
@@ -523,7 +523,7 @@ HttpStateData::reusableReply(HttpStateData::ReuseDecision &decision)
     case Http::scConflict: // TODO: is this shareable?
     case Http::scLengthRequired:
     case Http::scPreconditionFailed:
-    case Http::scPayloadTooLarge:
+    case Http::scContentTooLarge:
     case Http::scUnsupportedMediaType:
     case Http::scUnprocessableEntity:
     case Http::scLocked: // TODO: is this shareable?
index 71bde0343ba15848abfbc3644eee429bbdc547d5..a4aac20ba9a8f5a00e177ba45690598311785f95 100644 (file)
@@ -164,8 +164,8 @@ Http::StatusCodeString(const Http::StatusCode status)
         return "Precondition Failed";
         break;
 
-    case Http::scPayloadTooLarge:
-        return "Payload Too Large";
+    case Http::scContentTooLarge:
+        return "Content Too Large";
         break;
 
     case Http::scUriTooLong:
index d9f3620a754c3091bc46d7af35c6f748a274d501..b12a01eee63d2009a6499c4280c0521390b8cb55 100644 (file)
@@ -54,7 +54,7 @@ typedef enum {
     scGone = 410,
     scLengthRequired = 411,
     scPreconditionFailed = 412,
-    scPayloadTooLarge = 413,
+    scContentTooLarge = 413,
     scUriTooLong = 414,
     scUnsupportedMediaType = 415,
     scRequestedRangeNotSatisfied = 416,