Skip to content

Commit

Permalink
Auto merge of #22678 - nox:mime, r=SimonSapin
Browse files Browse the repository at this point in the history
Pull mime 0.3.13 and fix a MIME comparison in EventSource

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22678)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Jan 14, 2019
2 parents 1f9b134 + 8611b0f commit b1a4913
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 37 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -71,7 +71,7 @@ malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = "0.1"
metrics = {path = "../metrics"}
mitochondria = "1.1.2"
mime = "0.3"
mime = "0.3.13"
mime_guess = "2.0.0-alpha.6"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
Expand Down
20 changes: 8 additions & 12 deletions components/script/dom/eventsource.rs
Expand Up @@ -344,19 +344,15 @@ impl FetchResponseListener for EventSourceContext {
FetchMetadata::Unfiltered(m) => m,
FetchMetadata::Filtered { unsafe_, .. } => unsafe_,
};
match meta.content_type {
None => self.fail_the_connection(),
Some(ct) => {
if <ContentType as Into<Mime>>::into(ct.into_inner()) ==
mime::TEXT_EVENT_STREAM
{
self.origin = meta.final_url.origin().ascii_serialization();
self.announce_the_connection();
} else {
self.fail_the_connection()
}
},
let mime = match meta.content_type {
None => return self.fail_the_connection(),
Some(ct) => <ContentType as Into<Mime>>::into(ct.into_inner()),
};
if (mime.type_(), mime.subtype()) != (mime::TEXT, mime::EVENT_STREAM) {
return self.fail_the_connection();
}
self.origin = meta.final_url.origin().ascii_serialization();
self.announce_the_connection();
},
Err(_) => {
self.reestablish_the_connection();
Expand Down
@@ -1,7 +1,4 @@
[cors-safelisted-request-header.any.worker.html]
[No preflight for {"content-type":"text/plain;"}]
expected: FAIL

[Preflight for {"content-type":"text/plain\\f"}]
expected: FAIL

Expand All @@ -19,9 +16,6 @@


[cors-safelisted-request-header.any.html]
[No preflight for {"content-type":"text/plain;"}]
expected: FAIL

[Preflight for {"content-type":"text/plain\\f"}]
expected: FAIL

Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions tests/wpt/metadata/fetch/data-urls/processing.any.js.ini
Expand Up @@ -140,9 +140,6 @@
["data:†,X"]
expected: FAIL

["data:text/plain;,X"]
expected: FAIL

["data:x/x;base64;base64x,WA"]
expected: FAIL

Expand Down Expand Up @@ -292,9 +289,6 @@
["data:†,X"]
expected: FAIL

["data:text/plain;,X"]
expected: FAIL

["data:x/x;base64;base64x,WA"]
expected: FAIL

Expand Down

0 comments on commit b1a4913

Please sign in to comment.