From 194c91935bce7c82e3d3885e10e52f4fd1df926b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 15 Apr 2004 20:10:38 +0000 Subject: [PATCH] * server/util_xml.c (ap_xml_parse_input): Give a 413 (Request Entity Too Large) not a 400 if the client exceeds the configured XML request body limit. Reviewed by: Jeff Trawick, Brad Nicholes git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@103398 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +----- server/util_xml.c | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index 284c3d7ad67..055435c7856 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2004/04/15 19:54:49 $] +Last modified at [$Date: 2004/04/15 20:10:37 $] Release: @@ -175,10 +175,6 @@ PATCHES TO BACKPORT FROM 2.1 http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/dav/main/util.c?r1=1.53&r2=1.54 +1: jorton, nd - *) Issue a 413 not a 400 if client exceeds configured LimitXMLRequestBody - http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/util_xml.c?r1=1.28&r2=1.29 - +1: jorton, trawick, bnicholes - *) mod_dav: Send an EOS at the end of the multistatus brigade. http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/dav/main/mod_dav.c?r1=1.105&r2=1.106 +1: jorton diff --git a/server/util_xml.c b/server/util_xml.c index 7fb1993e249..24c7ea0e9e2 100644 --- a/server/util_xml.c +++ b/server/util_xml.c @@ -36,6 +36,7 @@ AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc) char errbuf[200]; apr_size_t total_read = 0; apr_size_t limit_xml_body = ap_get_limit_xml_body(r); + int result = HTTP_BAD_REQUEST; parser = apr_xml_parser_create(r->pool); brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc); @@ -78,6 +79,7 @@ AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc) ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "XML request body is larger than the configured " "limit of %lu", (unsigned long)limit_xml_body); + result = HTTP_REQUEST_ENTITY_TOO_LARGE; goto read_error; } @@ -121,5 +123,5 @@ AP_DECLARE(int) ap_xml_parse_input(request_rec * r, apr_xml_doc **pdoc) apr_brigade_destroy(brigade); /* Apache will supply a default error, plus the error log above. */ - return HTTP_BAD_REQUEST; + return result; } -- 2.47.2