martin 99/02/16 06:29:53
Modified: . STATUS src CHANGES src/main http_protocol.c src/modules/proxy proxy_util.c Log: Allow apache acting as a proxy server to relay the real reason of a failure to a client rather than the "internal server error" it does currently. The general exposure mechanism can be triggered by any module by setting the "verbose-error-to" note to "*"; this allows more than just proxy errors to be exposed. PR: 3455 Submitted by: Cliff Skolnick <[EMAIL PROTECTED]> Reviewed by: Roy Fielding, Dirk-Willem van Gulik, Martin Kraemer Revision Changes Path 1.626 +1 -6 apache-1.3/STATUS Index: STATUS =================================================================== RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.625 retrieving revision 1.626 diff -u -r1.625 -r1.626 --- STATUS 1999/02/16 13:44:40 1.625 +++ STATUS 1999/02/16 14:29:46 1.626 @@ -1,5 +1,5 @@ 1.3 STATUS: - Last modified at [$Date: 1999/02/16 13:44:40 $] + Last modified at [$Date: 1999/02/16 14:29:46 $] Release: @@ -73,11 +73,6 @@ * John Bley's [PATCH] malloc checks MID: <[EMAIL PROTECTED]> Status: Jim -0 (maybe the messages could be more detailed?) - - * Cliff's [PATCH] 500 errors not giving error-notes (related to PR #3455) - Message-ID: <[EMAIL PROTECTED]> - Status: Roy -1 [only because the strncmp may do a NULL compare, - easy to fix and then I'd +1] * Ralf's [PATCH] Shared Memory Pools Message-ID: <[EMAIL PROTECTED]> 1.1249 +8 -1 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1248 retrieving revision 1.1249 diff -u -r1.1248 -r1.1249 --- CHANGES 1999/02/10 12:27:25 1.1248 +++ CHANGES 1999/02/16 14:29:48 1.1249 @@ -1,5 +1,12 @@ Changes with Apache 1.3.5 + *) Allow apache acting as a proxy server to relay the real + reason of a failure to a client rather than the "internal + server error" it does currently. The general exposure mechanism + can be triggered by any module by setting the "verbose-error-to" + note to "*"; this allows more than just proxy errors to be exposed. + [Cliff Skolnick, Roy Fielding, Martin Kraemer] Related to PR#3455 + *) Moved man pages for ab and apachectrl to section 8. [Wilfredo Sanchez, Roy Fielding] @@ -42,7 +49,7 @@ *) proxy: The various calls to ap_proxyerror() can return HTTP/1.1 status code different from 500. This allows the proxy to, e.g., return - "403 Forbidden" for ProxyBlock'ed URL's. [Martin Kraemer] + "403 Forbidden" for ProxyBlock'ed URL's. [Martin Kraemer] Related to PR#3455 *) Fix ordering of language variants for the case where the traditional negotiation algorithm is being used with multiple language variants 1.258 +14 -1 apache-1.3/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.257 retrieving revision 1.258 diff -u -r1.257 -r1.258 --- http_protocol.c 1999/02/09 16:57:24 1.257 +++ http_protocol.c 1999/02/16 14:29:51 1.258 @@ -2520,7 +2520,19 @@ "accepted by the server for this resource.\n", fd); break; default: /* HTTP_INTERNAL_SERVER_ERROR */ - ap_bvputs(fd, "The server encountered an internal error or\n" + /* + * This comparison to expose error-notes could be modified to + * use a configuration directive and export based on that + * directive. For now "*" is used to designate an error-notes + * that is totally safe for any user to see (ie lacks paths, + * database passwords, etc.) + */ + if (((error_notes = ap_table_get(r->notes, "error-notes")) != NULL) + && (h1 = ap_table_get(r->notes, "verbose-error-to")) != NULL + && (strcmp(h1, "*") == 0)) { + ap_bvputs(fd, error_notes, "<P>\n", NULL); + } else { + ap_bvputs(fd, "The server encountered an internal error or\n" "misconfiguration and was unable to complete\n" "your request.<P>\n" "Please contact the server administrator,\n ", @@ -2530,6 +2542,7 @@ "caused the error.<P>\n" "More information about this error may be available\n" "in the server error log.<P>\n", NULL); + } /* * It would be nice to give the user the information they need to * fix the problem directly since many users don't have access to 1.77 +4 -0 apache-1.3/src/modules/proxy/proxy_util.c Index: proxy_util.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_util.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- proxy_util.c 1999/02/07 20:48:32 1.76 +++ proxy_util.c 1999/02/16 14:29:53 1.77 @@ -840,6 +840,10 @@ "<EM><A HREF=\"", r->uri, "\">", r->method, " ", r->uri, "</A></EM>.<P>\n" "Reason: <STRONG>", message, "</STRONG>", NULL)); + + /* Allow the "error-notes" string to be printed by ap_send_error_response() */ + ap_table_setn(r->notes, "verbose-error-to", ap_pstrdup(r->pool, "*")); + r->status_line = ap_psprintf(r->pool, "%3.3u Proxy Error", statuscode); return statuscode; }