Bug 1541598 - Have FetchBody::SetMimeType convert from ByteStrings to UTF8 CStrings to not corrupt Unicode values; r=hsivonen

Have FetchBody::SetMimeType convert from ByteStrings to UTF8 CStrings to not corrupt Unicode values

Differential Revision: https://phabricator.services.mozilla.com/D26011
This commit is contained in:
Thomas Wisniewski committed 2019-04-14 15:02:39 +00:00
1 parent b03ebaacad
commit 136622464a
2 files changed
+5258 -25335

No files matched your search

+2 -1
View File
@@ -1187,7 +1187,8 @@ void FetchBody<Derived>::SetMimeType() {
// HTTP ABNF states Content-Type may have only one value.
// This is from the "parse a header value" of the fetch spec.
if (!contentTypeValues.IsVoid() && contentTypeValues.Find(",") == -1) {
mMimeType = contentTypeValues;
// Convert from a bytestring to a UTF8 CString.
CopyLatin1toUTF8(contentTypeValues, mMimeType);
ToLowerCase(mMimeType);
}
}
File diff suppressed because it is too large. Load diff