check at startup.
PR 41887 [Jan van den Berg <janvdberg gmail.com>]
+ *) mod_autoindex: support XHTML as equivalent to HTML in IndexOptions,
+ ScanHTMLTitles, ReadmeName, HeaderName
+ PR 48416 [Dmitry Bakshaev <dab18 izhnet.ru>, Nick Kew]
+
Changes with Apache 2.3.4
*) Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
#define BY_TYPE &c_by_type
#define BY_PATH &c_by_path
+static inline int response_is_html(request_rec *r)
+{
+ char *ctype = ap_field_noparam(r->pool, r->content_type);
+ ap_str_tolower(ctype);
+ return !strcmp(ctype, "text/html")
+ || !strcmp(ctype, "application/xhtml+xml");
+}
+
/*
* This routine puts the standard HTML header at the top of the index page.
* We include the DOCTYPE because we may be using features therefrom (i.e.,
* SSIs.
*/
if (rr->content_type != NULL) {
- if (!strcasecmp(ap_field_noparam(r->pool, rr->content_type),
- "text/html")) {
+ if (response_is_html(rr)) {
ap_filter_t *f;
/* Hope everything will work... */
emit_amble = 0;
* SSIs.
*/
if (rr->content_type != NULL) {
- if (!strcasecmp(ap_field_noparam(r->pool, rr->content_type),
- "text/html")) {
+ if (response_is_html(rr)) {
ap_filter_t *f;
for (f=rr->output_filters;
f->frec != ap_subreq_core_filter_handle; f = f->next);
return NULL;
}
if ((r->content_type != NULL)
- && (!strcasecmp(ap_field_noparam(r->pool, r->content_type),
- "text/html")
+ && (response_is_html(r)
|| !strcmp(r->content_type, INCLUDES_MAGIC_TYPE))
&& !r->content_encoding) {
if (apr_file_open(&thefile, r->filename, APR_READ,