mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #25408 - pshaughn:wasmcase, r=jdm
Now using eq_ignore_case on WASM mimetype, per #25317 I have no idea how this would be tested. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25317 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
45cc558297
1 changed files with 7 additions and 10 deletions
|
@ -915,16 +915,13 @@ unsafe extern "C" fn consume_stream(
|
||||||
let mimetype = unwrapped_source.Headers().extract_mime_type();
|
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.
|
//Step 2.3 If mimeType is not `application/wasm`, return with a TypeError and abort these substeps.
|
||||||
match &mimetype[..] {
|
if !&mimetype[..].eq_ignore_ascii_case(b"application/wasm") {
|
||||||
b"application/wasm" | b"APPLICATION/wasm" | b"APPLICATION/WASM" => {},
|
|
||||||
_ => {
|
|
||||||
throw_dom_exception(
|
throw_dom_exception(
|
||||||
cx,
|
cx,
|
||||||
&global,
|
&global,
|
||||||
Error::Type("Response has unsupported MIME type".to_string()),
|
Error::Type("Response has unsupported MIME type".to_string()),
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Step 2.4 If response is not CORS-same-origin, return with a TypeError and abort these substeps.
|
//Step 2.4 If response is not CORS-same-origin, return with a TypeError and abort these substeps.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue