diff -Naur thttpd-2.25b-orig/libhttpd.c thttpd-2.25b-msie_xhtml/libhttpd.c --- thttpd-2.25b-orig/libhttpd.c 2003-12-25 20:06:05.000000000 +0100 +++ thttpd-2.25b-msie_xhtml/libhttpd.c 2007-05-01 15:14:36.000000000 +0200 @@ -2541,6 +2541,7 @@ int i, top, bot, mid; int r; char* default_type = "text/plain; charset=%s"; + char* nonxhtml_browser_type = "text/html"; /* Peel off encoding extensions until there aren't any more. */ n_me_indexes = 0; @@ -2598,6 +2599,14 @@ else { hc->type = typ_tab[mid].val; + if (!strncmp(typ_tab[mid].val, "application/xhtml+xml", + typ_tab[mid].val_len) && strstr(hc->useragent, "MSIE")) + { + syslog( LOG_INFO, + "Mimicing XHTML file for MSIE (User-Agent: %s)", + hc->useragent); + hc->type = nonxhtml_browser_type; + } goto done; } }