From 6a928281716a036723535da5eb2c0ac8689203d1 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 11 Sep 2009 21:55:46 +0000 Subject: [PATCH] Catch the somewhat absurd combination of a 417 error where no Expect header was present. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@814048 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_protocol.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 06c31b53df..1a3bf27909 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1011,16 +1011,19 @@ static const char *get_canned_error_string(int status, "request-header field overlap the current extent\n" "of the selected resource.

\n"); case HTTP_EXPECTATION_FAILED: - return(apr_pstrcat(p, - "

The expectation given in the Expect " - "request-header" - "\nfield could not be met by this server.

\n" - "

The client sent

\n    Expect: ",
-                           ap_escape_html(r->pool, apr_table_get(r->headers_in, "Expect")),
-                           "\n
\n" - "but we only allow the 100-continue " - "expectation.

\n", - NULL)); + s1 = apr_table_get(r->headers_in, "Expect"); + if (s1) + s1 = apr_pstrcat(p, + "

The expectation given in the Expect request-header\n" + "field could not be met by this server.\n" + "The client sent

\n    Expect: ",
+                     ap_escape_html(r->pool, s1), "\n
\n" + NULL); + else + s1 = "

No expectation was seen, the Expect request-header \n" + "field was not presented by the client.\n"; + return add_optional_notes(r, s1, "error-notes", "

" + "

Only the 100-continue expectation is supported.

\n"); case HTTP_UNPROCESSABLE_ENTITY: return("

The server understands the media type of the\n" "request entity, but was unable to process the\n" -- 2.40.0