1.08b - A minor improvement to XHTML / XML detection.

This commit is contained in:
Steve Pinkham 2010-03-21 20:09:10 -04:00
parent 5658c2c310
commit 6a67f575d8
3 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Version 1.08b:
--------------
- A minor improvement to XHTML / XML detection.
Version 1.07b:
--------------

View File

@ -1913,14 +1913,17 @@ static void detect_mime(struct http_request* req, struct http_response* res) {
return;
}
if (strstr((char*)sniffbuf, "<?xml")) {
if (strstr((char*)sniffbuf, "<?xml") ||
strstr((char*)sniffbuf, "<!DOCTYPE")) {
if (inl_strcasestr(sniffbuf, (u8*)"<!DOCTYPE html"))
if (strstr((char*)sniffbuf, "<!DOCTYPE html") ||
strstr((char*)sniffbuf, "http://www.w3.org/1999/xhtml"))
res->sniff_mime_id = MIME_XML_XHTML;
else
res->sniff_mime_id = MIME_XML_GENERIC;
return;
}
/* Do an unconvincing check for HTML once we ruled out

View File

@ -23,7 +23,7 @@
#ifndef _HAVE_CONFIG_H
#define _HAVE_CONFIG_H
#define VERSION "1.07b"
#define VERSION "1.08b"
#define USE_COLOR 1 /* Use terminal colors */