summaryrefslogtreecommitdiffstats
path: root/server/util_xml.c
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2004-03-14 21:53:58 +0100
committerJoe Orton <jorton@apache.org>2004-03-14 21:53:58 +0100
commit329a32cf742f3a937d4cd298c1d1696ecf21a1cc (patch)
treef76bb7ea691f6f294cb388893cba2de4bb23bb46 /server/util_xml.c
parentForward-port from mod_dav 1.0: (diff)
downloadapache2-329a32cf742f3a937d4cd298c1d1696ecf21a1cc.tar.xz
apache2-329a32cf742f3a937d4cd298c1d1696ecf21a1cc.zip
Forward-port from mod_dav 1.0:
* 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102959 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--server/util_xml.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/util_xml.c b/server/util_xml.c
index a8bd36d25f..069345d310 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);
@@ -81,6 +82,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;
}
@@ -124,5 +126,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;
}