DescriptionDon't use SVG resource documents with an unrecognized MIME-type
Before parsing/creating the actual document of a DocumentResource, make
sure that the resource in question was actually served as a reasonable
MIME-type - one of:
image/svg+xml,
text/xml,
application/xml or
application/xhtml+xml
Use the original Content-Type from the HTTP header when possible and
treat empty as invalid (matches Gecko).
This could help mitigate some issues with content sanitation. It seems
to match what Gecko is doing so is hopefully not too web-incompatible.
Move the commonly recurring *Resource::mimeType() helper from subclasses
to the baseclass (Resource) and rename it httpContentType() since that
should be a better match for what it is.
BUG=527514
Committed: https://crrev.com/57642dc1f2d31bcade1c741f0e7a119ca9754537
Cr-Commit-Position: refs/heads/master@{#377560}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Use testharness; add unit test for extractMIMETypeFromMediaType #Messages
Total messages: 19 (6 generated)
|