You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by pq...@apache.org on 2005/07/20 13:20:36 UTC

svn commit: r219879 - in /httpd/httpd/trunk: CHANGES modules/mappers/mod_negotiation.c

Author: pquerna
Date: Wed Jul 20 04:20:33 2005
New Revision: 219879

URL: http://svn.apache.org/viewcvs?rev=219879&view=rev
Log:
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.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/mappers/mod_negotiation.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?rev=219879&r1=219878&r2=219879&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Jul 20 04:20:33 2005
@@ -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)

Modified: httpd/httpd/trunk/modules/mappers/mod_negotiation.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/mappers/mod_negotiation.c?rev=219879&r1=219878&r2=219879&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_negotiation.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_negotiation.c Wed Jul 20 04:20:33 2005
@@ -957,7 +957,12 @@
                 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);