mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Subtle variation for security. If the mod_mime file has nothing specific
to say about a given set of file extentions (and has only based the resolved fields on the default language, encoding and content type) then tell us we can ignore the result by leaving the exception list entirely undefined. If mod_mime adds anything (a language, charset, or whatnot) then proceed to use the file in the Multiviews evaluation, otherwise mod_negotation will ignore the file found. This points out a need for a slightly twisted DefaultClientLanguage, as opposed to creating foo.html.html files. Either that, or introduce a 'neutral' entity that the user can list (say, .default) for mod_mime to declare it as a fallback language/encoding/content-type/handler. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89919 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -787,6 +787,7 @@ static int find_ct(request_rec *r)
|
||||
char *ext;
|
||||
const char *type;
|
||||
const char *charset = NULL;
|
||||
int found_any = 0;
|
||||
apr_array_header_t *exception_list =
|
||||
apr_array_make(r->pool, 2, sizeof(char *));
|
||||
|
||||
@@ -869,15 +870,18 @@ static int find_ct(request_rec *r)
|
||||
|
||||
/* Not good... nobody claims it.
|
||||
*/
|
||||
if (!found)
|
||||
if (found)
|
||||
found_any = 1;
|
||||
else
|
||||
*((const char **) apr_array_push(exception_list)) = ext;
|
||||
}
|
||||
|
||||
/*
|
||||
* Need to set a notes entry on r for unrecognized elements.
|
||||
* Somebody better claim them!
|
||||
* Somebody better claim them! If we did absolutely nothing,
|
||||
* skip the notes to alert mod_negotiation we are clueless.
|
||||
*/
|
||||
if (exception_list->nelts) {
|
||||
if (found_any) {
|
||||
apr_table_setn(r->notes, "ap-mime-exceptions-list",
|
||||
(void *)exception_list);
|
||||
}
|
||||
|
Reference in New Issue
Block a user