mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Tweak the MIME comparison in EventSource
MIME parameters should not be inspected when checking for text/event-stream.
This commit is contained in:
parent
bec1c396de
commit
8611b0f8c4
1 changed files with 8 additions and 12 deletions
|
@ -344,19 +344,15 @@ impl FetchResponseListener for EventSourceContext {
|
||||||
FetchMetadata::Unfiltered(m) => m,
|
FetchMetadata::Unfiltered(m) => m,
|
||||||
FetchMetadata::Filtered { unsafe_, .. } => unsafe_,
|
FetchMetadata::Filtered { unsafe_, .. } => unsafe_,
|
||||||
};
|
};
|
||||||
match meta.content_type {
|
let mime = match meta.content_type {
|
||||||
None => self.fail_the_connection(),
|
None => return self.fail_the_connection(),
|
||||||
Some(ct) => {
|
Some(ct) => <ContentType as Into<Mime>>::into(ct.into_inner()),
|
||||||
if <ContentType as Into<Mime>>::into(ct.into_inner()) ==
|
};
|
||||||
mime::TEXT_EVENT_STREAM
|
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();
|
|
||||||
} else {
|
|
||||||
self.fail_the_connection()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
self.origin = meta.final_url.origin().ascii_serialization();
|
||||||
|
self.announce_the_connection();
|
||||||
},
|
},
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
self.reestablish_the_connection();
|
self.reestablish_the_connection();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue