|
|
8b0621 |
diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c
|
|
|
8b0621 |
index e419eb6..dcafa9c 100644
|
|
|
8b0621 |
--- a/modules/http/http_protocol.c
|
|
|
8b0621 |
+++ b/modules/http/http_protocol.c
|
|
|
8b0621 |
@@ -1132,13 +1132,10 @@ static const char *get_canned_error_string(int status,
|
|
|
8b0621 |
"\">here.\n",
|
|
|
8b0621 |
NULL));
|
|
|
8b0621 |
case HTTP_USE_PROXY:
|
|
|
8b0621 |
- return(apr_pstrcat(p,
|
|
|
8b0621 |
- "This resource is only accessible "
|
|
|
8b0621 |
- "through the proxy\n",
|
|
|
8b0621 |
- ap_escape_html(r->pool, location),
|
|
|
8b0621 |
- " \nYou will need to configure "
|
|
|
8b0621 |
- "your client to use that proxy.\n",
|
|
|
8b0621 |
- NULL));
|
|
|
8b0621 |
+ return("This resource is only accessible "
|
|
|
8b0621 |
+ "through the proxy\n"
|
|
|
8b0621 |
+ " \nYou will need to configure "
|
|
|
8b0621 |
+ "your client to use that proxy.\n");
|
|
|
8b0621 |
case HTTP_PROXY_AUTHENTICATION_REQUIRED:
|
|
|
8b0621 |
case HTTP_UNAUTHORIZED:
|
|
|
8b0621 |
return("This server could not verify that you\n"
|
|
|
8b0621 |
@@ -1154,34 +1151,20 @@ static const char *get_canned_error_string(int status,
|
|
|
8b0621 |
"error-notes",
|
|
|
8b0621 |
"\n"));
|
|
|
8b0621 |
case HTTP_FORBIDDEN:
|
|
|
8b0621 |
- s1 = apr_pstrcat(p,
|
|
|
8b0621 |
- "You don't have permission to access ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- "\non this server. \n",
|
|
|
8b0621 |
- NULL);
|
|
|
8b0621 |
- return(add_optional_notes(r, s1, "error-notes", "\n"));
|
|
|
8b0621 |
+ return(add_optional_notes(r, "You don't have permission to access this resource.", "error-notes", " \n"));
|
|
|
8b0621 |
case HTTP_NOT_FOUND:
|
|
|
8b0621 |
- return(apr_pstrcat(p,
|
|
|
8b0621 |
- "The requested URL ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- " was not found on this server.\n",
|
|
|
8b0621 |
- NULL));
|
|
|
8b0621 |
+ return("The requested URL was not found on this server. \n");
|
|
|
8b0621 |
case HTTP_METHOD_NOT_ALLOWED:
|
|
|
8b0621 |
return(apr_pstrcat(p,
|
|
|
8b0621 |
"The requested method ",
|
|
|
8b0621 |
ap_escape_html(r->pool, r->method),
|
|
|
8b0621 |
- " is not allowed for the URL ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- ".\n",
|
|
|
8b0621 |
+ " is not allowed for this URL.\n",
|
|
|
8b0621 |
NULL));
|
|
|
8b0621 |
case HTTP_NOT_ACCEPTABLE:
|
|
|
8b0621 |
- s1 = apr_pstrcat(p,
|
|
|
8b0621 |
- "An appropriate representation of the "
|
|
|
8b0621 |
- "requested resource ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- " could not be found on this server.\n",
|
|
|
8b0621 |
- NULL);
|
|
|
8b0621 |
- return(add_optional_notes(r, s1, "variant-list", ""));
|
|
|
8b0621 |
+ return(add_optional_notes(r,
|
|
|
8b0621 |
+ "An appropriate representation of the requested resource "
|
|
|
8b0621 |
+ "could not be found on this server.\n",
|
|
|
8b0621 |
+ "variant-list", ""));
|
|
|
8b0621 |
case HTTP_MULTIPLE_CHOICES:
|
|
|
8b0621 |
return(add_optional_notes(r, "", "variant-list", ""));
|
|
|
8b0621 |
case HTTP_LENGTH_REQUIRED:
|
|
|
8b0621 |
@@ -1192,18 +1175,13 @@ static const char *get_canned_error_string(int status,
|
|
|
8b0621 |
NULL);
|
|
|
8b0621 |
return(add_optional_notes(r, s1, "error-notes", "\n"));
|
|
|
8b0621 |
case HTTP_PRECONDITION_FAILED:
|
|
|
8b0621 |
- return(apr_pstrcat(p,
|
|
|
8b0621 |
- "The precondition on the request "
|
|
|
8b0621 |
- "for the URL ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- " evaluated to false.\n",
|
|
|
8b0621 |
- NULL));
|
|
|
8b0621 |
+ return("The precondition on the request "
|
|
|
8b0621 |
+ "for this URL evaluated to false.\n");
|
|
|
8b0621 |
case HTTP_NOT_IMPLEMENTED:
|
|
|
8b0621 |
s1 = apr_pstrcat(p,
|
|
|
8b0621 |
"",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->method), " to ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- " not supported. \n",
|
|
|
8b0621 |
+ ap_escape_html(r->pool, r->method), " ",
|
|
|
8b0621 |
+ " not supported for current URL. \n",
|
|
|
8b0621 |
NULL);
|
|
|
8b0621 |
return(add_optional_notes(r, s1, "error-notes", "\n"));
|
|
|
8b0621 |
case HTTP_BAD_GATEWAY:
|
|
|
8b0621 |
@@ -1211,29 +1189,19 @@ static const char *get_canned_error_string(int status,
|
|
|
8b0621 |
"response from an upstream server. " CRLF;
|
|
|
8b0621 |
return(add_optional_notes(r, s1, "error-notes", "\n"));
|
|
|
8b0621 |
case HTTP_VARIANT_ALSO_VARIES:
|
|
|
8b0621 |
- return(apr_pstrcat(p,
|
|
|
8b0621 |
- "A variant for the requested "
|
|
|
8b0621 |
- "resource\n\n",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- "\n\nis itself a negotiable resource. "
|
|
|
8b0621 |
- "This indicates a configuration error.\n",
|
|
|
8b0621 |
- NULL));
|
|
|
8b0621 |
+ return("A variant for the requested "
|
|
|
8b0621 |
+ "resource\n\n"
|
|
|
8b0621 |
+ "\n\nis itself a negotiable resource. "
|
|
|
8b0621 |
+ "This indicates a configuration error.\n");
|
|
|
8b0621 |
case HTTP_REQUEST_TIME_OUT:
|
|
|
8b0621 |
return("Server timeout waiting for the HTTP request from the client. \n");
|
|
|
8b0621 |
case HTTP_GONE:
|
|
|
8b0621 |
- return(apr_pstrcat(p,
|
|
|
8b0621 |
- "The requested resource ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- " \nis no longer available on this server "
|
|
|
8b0621 |
- "and there is no forwarding address.\n"
|
|
|
8b0621 |
- "Please remove all references to this "
|
|
|
8b0621 |
- "resource.\n",
|
|
|
8b0621 |
- NULL));
|
|
|
8b0621 |
+ return("The requested resource is no longer available on this server"
|
|
|
8b0621 |
+ " and there is no forwarding address.\n"
|
|
|
8b0621 |
+ "Please remove all references to this resource.\n");
|
|
|
8b0621 |
case HTTP_REQUEST_ENTITY_TOO_LARGE:
|
|
|
8b0621 |
return(apr_pstrcat(p,
|
|
|
8b0621 |
- "The requested resource ",
|
|
|
8b0621 |
- ap_escape_html(r->pool, r->uri), " \n",
|
|
|
8b0621 |
- "does not allow request data with ",
|
|
|
8b0621 |
+ "The requested resource does not allow request data with ",
|
|
|
8b0621 |
ap_escape_html(r->pool, r->method),
|
|
|
8b0621 |
" requests, or the amount of data provided in\n"
|
|
|
8b0621 |
"the request exceeds the capacity limit.\n",
|
|
|
8b0621 |
@@ -1317,11 +1285,9 @@ static const char *get_canned_error_string(int status,
|
|
|
8b0621 |
"the Server Name Indication (SNI) in use for this\n"
|
|
|
8b0621 |
"connection.\n");
|
|
|
8b0621 |
case HTTP_UNAVAILABLE_FOR_LEGAL_REASONS:
|
|
|
8b0621 |
- s1 = apr_pstrcat(p,
|
|
|
8b0621 |
- "Access to ", ap_escape_html(r->pool, r->uri),
|
|
|
8b0621 |
- "\nhas been denied for legal reasons. \n",
|
|
|
8b0621 |
- NULL);
|
|
|
8b0621 |
- return(add_optional_notes(r, s1, "error-notes", "\n"));
|
|
|
8b0621 |
+ return(add_optional_notes(r,
|
|
|
8b0621 |
+ "Access to this URL has been denied for legal reasons. \n",
|
|
|
8b0621 |
+ "error-notes", "\n"));
|
|
|
8b0621 |
default: /* HTTP_INTERNAL_SERVER_ERROR */
|
|
|
8b0621 |
/*
|
|
|
8b0621 |
* This comparison to expose error-notes could be modified to
|
|
|
8b0621 |
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
|
|
|
8b0621 |
index 800ede1..de48735 100644
|
|
|
8b0621 |
--- a/modules/proxy/mod_proxy.c
|
|
|
8b0621 |
+++ b/modules/proxy/mod_proxy.c
|
|
|
8b0621 |
@@ -1055,9 +1055,10 @@ static int proxy_handler(request_rec *r)
|
|
|
8b0621 |
char *end;
|
|
|
8b0621 |
maxfwd = apr_strtoi64(str, &end, 10);
|
|
|
8b0621 |
if (maxfwd < 0 || maxfwd == APR_INT64_MAX || *end) {
|
|
|
8b0621 |
- return ap_proxyerror(r, HTTP_BAD_REQUEST,
|
|
|
8b0621 |
- apr_psprintf(r->pool,
|
|
|
8b0621 |
- "Max-Forwards value '%s' could not be parsed", str));
|
|
|
8b0621 |
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO()
|
|
|
8b0621 |
+ "Max-Forwards value '%s' could not be parsed", str);
|
|
|
8b0621 |
+ return ap_proxyerror(r, HTTP_BAD_REQUEST,
|
|
|
8b0621 |
+ "Max-Forwards request header could not be parsed");
|
|
|
8b0621 |
}
|
|
|
8b0621 |
else if (maxfwd == 0) {
|
|
|
8b0621 |
switch (r->method_number) {
|
|
|
8b0621 |
diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c
|
|
|
8b0621 |
index 4a10987..8f6f853 100644
|
|
|
8b0621 |
--- a/modules/proxy/mod_proxy_ftp.c
|
|
|
8b0621 |
+++ b/modules/proxy/mod_proxy_ftp.c
|
|
|
8b0621 |
@@ -1024,8 +1024,9 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
|
|
|
8b0621 |
/* We break the URL into host, port, path-search */
|
|
|
8b0621 |
if (r->parsed_uri.hostname == NULL) {
|
|
|
8b0621 |
if (APR_SUCCESS != apr_uri_parse(p, url, &uri)) {
|
|
|
8b0621 |
- return ap_proxyerror(r, HTTP_BAD_REQUEST,
|
|
|
8b0621 |
- apr_psprintf(p, "URI cannot be parsed: %s", url));
|
|
|
8b0621 |
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO()
|
|
|
8b0621 |
+ "URI cannot be parsed: %s", url);
|
|
|
8b0621 |
+ return ap_proxyerror(r, HTTP_BAD_REQUEST, "URI cannot be parsed");
|
|
|
8b0621 |
}
|
|
|
8b0621 |
connectname = uri.hostname;
|
|
|
8b0621 |
connectport = uri.port;
|
|
|
8b0621 |
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
|
|
|
8b0621 |
index 6501c68..0bbfa59 100644
|
|
|
8b0621 |
--- a/modules/proxy/proxy_util.c
|
|
|
8b0621 |
+++ b/modules/proxy/proxy_util.c
|
|
|
8b0621 |
@@ -368,12 +368,9 @@ PROXY_DECLARE(char *)
|
|
|
8b0621 |
|
|
|
8b0621 |
PROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message)
|
|
|
8b0621 |
{
|
|
|
8b0621 |
- const char *uri = ap_escape_html(r->pool, r->uri);
|
|
|
8b0621 |
apr_table_setn(r->notes, "error-notes",
|
|
|
8b0621 |
apr_pstrcat(r->pool,
|
|
|
8b0621 |
- "The proxy server could not handle the request
|
|
|
8b0621 |
- uri, "\">", ap_escape_html(r->pool, r->method), " ", uri,
|
|
|
8b0621 |
- ".\n"
|
|
|
8b0621 |
+ "The proxy server could not handle the request"
|
|
|
8b0621 |
"Reason: ", ap_escape_html(r->pool, message),
|
|
|
8b0621 |
"",
|
|
|
8b0621 |
NULL));
|