mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Fix issues with PR #6171
This commit is contained in:
parent
e840698d4a
commit
f5a0285833
1 changed files with 9 additions and 9 deletions
|
@ -104,17 +104,17 @@ pub fn start_sending_sniffed_opt(start_chan: LoadConsumer, mut metadata: Metadat
|
|||
|
||||
if let Some(ref headers) = metadata.headers {
|
||||
if let Some(ref raw_content_type) = headers.get_raw("content-type") {
|
||||
let ref last_raw_content_type = raw_content_type[raw_content_type.len() - 1];
|
||||
check_for_apache_bug = last_raw_content_type == b"text/plain"
|
||||
|| last_raw_content_type == b"text/plain; charset=ISO-8859-1"
|
||||
|| last_raw_content_type == b"text/plain; charset=iso-8859-1"
|
||||
|| last_raw_content_type == b"text/plain; charset=UTF-8";
|
||||
}
|
||||
if let Some(ref raw_content_type_options) = headers.get_raw("content-type-options") {
|
||||
for options in raw_content_type_options.iter() {
|
||||
nosniff = nosniff || options == b"nosniff";
|
||||
if raw_content_type.len() > 0 {
|
||||
let ref last_raw_content_type = raw_content_type[raw_content_type.len() - 1];
|
||||
check_for_apache_bug = last_raw_content_type == b"text/plain"
|
||||
|| last_raw_content_type == b"text/plain; charset=ISO-8859-1"
|
||||
|| last_raw_content_type == b"text/plain; charset=iso-8859-1"
|
||||
|| last_raw_content_type == b"text/plain; charset=UTF-8";
|
||||
}
|
||||
}
|
||||
if let Some(ref raw_content_type_options) = headers.get_raw("X-content-type-options") {
|
||||
nosniff = raw_content_type_options.iter().any(|ref opt| *opt == b"nosniff");
|
||||
}
|
||||
}
|
||||
|
||||
let supplied_type = metadata.content_type.map(|ContentType(Mime(toplevel, sublevel, _))| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue