Browse Source

Merge pull request #15166 from wangkx/h25894

HPCC-25894 Report 413 Request Entity Too Large error in ESP

Reviewed-By: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Reviewed-By: Rodrigo Pastrana <rodrigo.pastrana@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 years ago
parent
commit
d33279406b

+ 1 - 1
esp/bindings/http/platform/httptransport.cpp

@@ -1996,7 +1996,7 @@ int CHttpRequest::processHeaders(IMultiException *me)
     if(m_content_length > 0 && m_MaxRequestEntityLength > 0 && m_content_length > m_MaxRequestEntityLength && (!isUpload(false)))
     {
         UERRLOG("Bad request: Content-Length exceeded maxRequestEntityLength");
-        throw createEspHttpException(HTTP_STATUS_BAD_REQUEST_CODE, "The request length was too long.", HTTP_STATUS_BAD_REQUEST);
+        throw createEspHttpException(HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE_CODE, "The request length was too long.", HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE);
     }
     setPersistentEligible(checkPersistentEligible());
 

+ 1 - 0
esp/bindings/http/platform/httptransport.hpp

@@ -39,6 +39,7 @@
 #define HTTP_STATUS_FORBIDDEN               "403 Forbidden"
 #define HTTP_STATUS_NOT_FOUND               "404 Not Found"
 #define HTTP_STATUS_NOT_ALLOWED             "405 Method Not Allowed"
+#define HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE   "413 Request Entity Too Large"
 #define HTTP_STATUS_INTERNAL_SERVER_ERROR   "500 Internal Server Error"
 #define HTTP_STATUS_NOT_IMPLEMENTED         "501 Not Implemented"