fixes bug 210229 "Helper app Window for text/html document (two comma-delimited charsets in http content-type header)" r=biesi sr=bz

git-svn-id: svn://10.0.0.236/trunk@145426 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%meer.net 2003-07-31 17:11:21 +00:00
parent 0bb8f3d644
commit d3d7d51768

View File

@ -624,9 +624,12 @@ nsHttpResponseHead::ParseContentType(char *type)
// if the server sent "*/*", it is meaningless, so do not store it.
// also, if type is the same as mContentType, then just update the
// charset. however, if charset is empty and mContentType hasn't
// changed, then don't wipe-out an existing mContentCharset.
// changed, then don't wipe-out an existing mContentCharset. we
// also want to reject a mime-type if it does not include a slash.
// some servers give junk after the charset parameter, which may
// include a comma, so this check makes us a bit more tolerant.
if (*type && strcmp(type, "*/*") != 0) {
if (*type && strcmp(type, "*/*") != 0 && strchr(type, '/')) {
PRBool eq = mContentType.Equals(Substring(type, typeEnd));
if (!eq)
mContentType.Assign(type, typeEnd - type);