mturk 2005/03/17 04:06:03 Modified: jk/native/apache-1.3 mod_jk.c jk/native/apache-2.0 mod_jk.c jk/native/iis jk_isapi_plugin.c Log: Use 404 instead 403 when client tries to access WEB-INF. This is to comply with Servlet spec. Revision Changes Path 1.74 +3 -3 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c Index: mod_jk.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- mod_jk.c 22 Feb 2005 14:40:36 -0000 1.73 +++ mod_jk.c 17 Mar 2005 12:06:03 -0000 1.74 @@ -2122,9 +2122,9 @@ if (!strcasecmp(child_dir, "WEB-INF") || !strcasecmp(child_dir, "META-INF")) { jk_log(l, JK_LOG_DEBUG, - "mod_jk::jk_translate, AutoAlias FORBIDDEN for URI: %s", + "mod_jk::jk_translate, AutoAlias HTTP_NOT_FOUND for URI: %s", r->uri); - return FORBIDDEN; + return HTTP_NOT_FOUND; } } } 1.131 +3 -3 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c Index: mod_jk.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v retrieving revision 1.130 retrieving revision 1.131 diff -u -r1.130 -r1.131 --- mod_jk.c 22 Feb 2005 14:40:37 -0000 1.130 +++ mod_jk.c 17 Mar 2005 12:06:03 -0000 1.131 @@ -2568,9 +2568,9 @@ || !strcasecmp(child_dir, "META-INF")) { if (JK_IS_DEBUG_LEVEL(conf->log)) jk_log(conf->log, JK_LOG_DEBUG, - "mod_jk::jk_translate, AutoAlias HTTP_FORBIDDEN for URI: %s", + "mod_jk::jk_translate, AutoAlias HTTP_NOT_FOUND for URI: %s", r->uri); - return HTTP_FORBIDDEN; + return HTTP_NOT_FOUND; } } } 1.45 +49 -49 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- jk_isapi_plugin.c 25 Feb 2005 10:54:26 -0000 1.44 +++ jk_isapi_plugin.c 17 Mar 2005 12:06:03 -0000 1.45 @@ -79,11 +79,11 @@ "Your browser (or proxy) sent a request that " \ "this server could not understand.</DL></DD></BODY></HTML>" -#define HTML_ERROR_403 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">" \ - "<HTML><HEAD><TITLE>Access forbidden!!</TITLE></HEAD>" \ - "<BODY><H1>Access forbidden!</H1><DL><DD>\n" \ - "You don't have permission to access the requested object." \ - "It is either read-protected or not readable by the server.</DL></DD></BODY></HTML>" +#define HTML_ERROR_404 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">" \ + "<HTML><HEAD><TITLE>Object not found!</TITLE></HEAD>" \ + "<BODY><H1>The requested URL was not found on this server" \ + "</H1><DL><DD>\nIf you entered the URL manually please check your" \ + "spelling and try again.</DL></DD></BODY></HTML>" #define JK_TOLOWER(x) ((char)tolower((BYTE)(x))) @@ -337,42 +337,42 @@ int status; char *reason; } *r, reasons[] = { - { 100, "Continue" }, - { 101, "Switching Protocols" }, - { 200, "OK" }, - { 201, "Created" }, - { 202, "Accepted" }, - { 203, "Non-Authoritative Information" }, - { 204, "No Content" }, - { 205, "Reset Content" }, - { 206, "Partial Content" }, - { 300, "Multiple Choices" }, - { 301, "Moved Permanently" }, - { 302, "Moved Temporarily" }, - { 303, "See Other" }, - { 304, "Not Modified" }, - { 305, "Use Proxy" }, - { 400, "Bad Request" }, - { 401, "Unauthorized" }, - { 402, "Payment Required" }, - { 403, "Forbidden" }, - { 404, "Not Found" }, - { 405, "Method Not Allowed" }, - { 406, "Not Acceptable" }, - { 407, "Proxy Authentication Required" }, - { 408, "Request Timeout" }, - { 409, "Conflict" }, - { 410, "Gone" }, - { 411, "Length Required" }, - { 412, "Precondition Failed" }, - { 413, "Request Entity Too Large" }, - { 414, "Request-URI Too Long" }, - { 415, "Unsupported Media Type" }, - { 500, "Internal Server Error" }, - { 501, "Not Implemented" }, - { 502, "Bad Gateway" }, - { 503, "Service Unavailable" }, - { 504, "Gateway Timeout" }, + { 100, "Continue" }, + { 101, "Switching Protocols" }, + { 200, "OK" }, + { 201, "Created" }, + { 202, "Accepted" }, + { 203, "Non-Authoritative Information" }, + { 204, "No Content" }, + { 205, "Reset Content" }, + { 206, "Partial Content" }, + { 300, "Multiple Choices" }, + { 301, "Moved Permanently" }, + { 302, "Moved Temporarily" }, + { 303, "See Other" }, + { 304, "Not Modified" }, + { 305, "Use Proxy" }, + { 400, "Bad Request" }, + { 401, "Unauthorized" }, + { 402, "Payment Required" }, + { 403, "Forbidden" }, + { 404, "Not Found" }, + { 405, "Method Not Allowed" }, + { 406, "Not Acceptable" }, + { 407, "Proxy Authentication Required" }, + { 408, "Request Timeout" }, + { 409, "Conflict" }, + { 410, "Gone" }, + { 411, "Length Required" }, + { 412, "Precondition Failed" }, + { 413, "Request Entity Too Large" }, + { 414, "Request-URI Too Long" }, + { 415, "Unsupported Media Type" }, + { 500, "Internal Server Error" }, + { 501, "Not Implemented" }, + { 502, "Bad Gateway" }, + { 503, "Service Unavailable" }, + { 504, "Gateway Timeout" }, { 505, "HTTP Version Not Supported" }, { 000, NULL} }; @@ -384,7 +384,7 @@ else r++; return "No Reason"; -} +} static int escape_url(const char *path, char *dest, int destsize) { @@ -775,8 +775,8 @@ jk_log(logger, JK_LOG_EMERG, "[%s] contains forbidden escape sequences.", uri); - write_error_response(pfc, "403 Forbidden", - HTML_ERROR_403); + write_error_response(pfc, "404 Not Found", + HTML_ERROR_404); return SF_STATUS_REQ_FINISHED; } getparents(uri); @@ -830,8 +830,8 @@ "[%s] points to the web-inf or meta-inf directory.\nSomebody try to hack into the site!!!", uri); - write_error_response(pfc, "403 Forbidden", - HTML_ERROR_403); + write_error_response(pfc, "404 Not Found", + HTML_ERROR_404); return SF_STATUS_REQ_FINISHED; } @@ -1085,14 +1085,14 @@ if (!jk_open_file_logger(&logger, log_file, log_level)) { logger = NULL; } - /* Simulate shared memory + /* Simulate shared memory * For now use fixed size. */ jk_shm_open(NULL, JK_SHM_DEF_SIZE, logger); /* 10 is minimum supported on WINXP */ jk_set_worker_def_cache_size(10); - + /* Logging the initialization type: registry or properties file in virtual dir */ if (JK_IS_DEBUG_LEVEL(logger)) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]