mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Merge request type and destination
This commit is contained in:
parent
48c715c1c8
commit
c6bb1cb9d5
20 changed files with 88 additions and 152 deletions
|
@ -17,7 +17,7 @@ use hyper::status::StatusCode;
|
|||
use hyper::version::HttpVersion;
|
||||
use net_traits::{CookieSource, MessageData, NetworkError, WebSocketCommunicate, WebSocketConnectData};
|
||||
use net_traits::{WebSocketDomAction, WebSocketNetworkEvent};
|
||||
use net_traits::request::{Destination, Type};
|
||||
use net_traits::request::Destination;
|
||||
use servo_url::ServoUrl;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::io::{self, Write};
|
||||
|
@ -280,7 +280,7 @@ fn fetch(url: ServoUrl,
|
|||
// TODO: handle request's origin.
|
||||
|
||||
// Step 3.
|
||||
set_default_accept(Type::None, Destination::None, &mut headers);
|
||||
set_default_accept(Destination::None, &mut headers);
|
||||
|
||||
// Step 4.
|
||||
set_default_accept_language(&mut headers);
|
||||
|
@ -370,7 +370,7 @@ fn main_fetch(url: ServoUrl,
|
|||
// TODO: handle blocking as mixed content.
|
||||
// TODO: handle blocking by content security policy.
|
||||
// Not applicable: blocking due to MIME type matters only for scripts.
|
||||
if should_be_blocked_due_to_nosniff(Type::None, &headers) {
|
||||
if should_be_blocked_due_to_nosniff(Destination::None, &headers) {
|
||||
response = Err(NetworkError::Internal("Request should be blocked due to nosniff.".into()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue