From: Paul Querna Date: Wed, 20 Jul 2005 11:20:33 +0000 (+0000) Subject: Check an alternative return value for when a file or directory does not exist. Previ... X-Git-Tag: 2.1.7~5^2~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a286fd49e411f0808fcaa6b1e4213ab87104326;p=apache Check an alternative return value for when a file or directory does not exist. Previously this would return a forbidden on the documentation website for any URL ending in .html. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@219879 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 8ae9112ee4..2ccc366950 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.1.7 [Remove entries to the current 2.0 section below, when backported] - + + *) mod_negotiation: Correctly report 404 instead of 403 for missing files. + [Paul Querna] + *) new hook (request_status) that gets ran in proxy_handler just before the final return. This gives modules an opportunity to do something based on the proxy status. (minor MMN bump) diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 0e94210bf4..9676adf394 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -957,7 +957,12 @@ static int read_type_map(apr_file_t **map, negotiation_state *neg, APR_OS_DEFAULT, neg->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, "cannot access type map file: %s", rr->filename); - return APR_STATUS_IS_ENOENT(status) ? HTTP_NOT_FOUND : HTTP_FORBIDDEN; + if (APR_STATUS_IS_ENOTDIR(status) || APR_STATUS_IS_ENOENT(status)) { + return HTTP_NOT_FOUND; + } + else { + return HTTP_FORBIDDEN; + } } clean_var_rec(&mime_info);