aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_runtime.rs
diff options
context:
space:
mode:
authorPatrick Shaughnessy <pshaughn@comcast.net>2019-12-31 18:26:45 -0500
committerPatrick Shaughnessy <pshaughn@comcast.net>2019-12-31 18:26:45 -0500
commit1506643f9adf04c5e6f49c3a1b5ece44efe8631d (patch)
treeb0b6b0e6974e9480a2d70cfefd59e589158d7958 /components/script/script_runtime.rs
parent90acd1adc3aa0300e5dea94855c595a19e718c6c (diff)
downloadservo-1506643f9adf04c5e6f49c3a1b5ece44efe8631d.tar.gz
servo-1506643f9adf04c5e6f49c3a1b5ece44efe8631d.zip
Now using eq_ignore_case on WASM mimetype, per #25317
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r--components/script/script_runtime.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index 02a6b42b854..3f82e3496e6 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -915,16 +915,13 @@ unsafe extern "C" fn consume_stream(
let mimetype = unwrapped_source.Headers().extract_mime_type();
//Step 2.3 If mimeType is not `application/wasm`, return with a TypeError and abort these substeps.
- match &mimetype[..] {
- b"application/wasm" | b"APPLICATION/wasm" | b"APPLICATION/WASM" => {},
- _ => {
- throw_dom_exception(
- cx,
- &global,
- Error::Type("Response has unsupported MIME type".to_string()),
- );
- return false;
- },
+ if !&mimetype[..].eq_ignore_ascii_case(b"application/wasm") {
+ throw_dom_exception(
+ cx,
+ &global,
+ Error::Type("Response has unsupported MIME type".to_string()),
+ );
+ return false;
}
//Step 2.4 If response is not CORS-same-origin, return with a TypeError and abort these substeps.