mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Address PR comments
- Remove fn `url_is_local` - Remove fn `set_local_urls_only` - Fix `test_fetch_with_local_urls_only`
This commit is contained in:
parent
6576fde29b
commit
3ec4515a73
3 changed files with 12 additions and 17 deletions
|
@ -110,8 +110,11 @@ fn main_fetch(request: Rc<Request>, cors_flag: bool, recursive_flag: bool) -> Re
|
|||
let mut response = None;
|
||||
|
||||
// Step 2
|
||||
if request.local_urls_only && !url_is_local(&request.current_url()) {
|
||||
response = Some(Response::network_error());
|
||||
if request.local_urls_only {
|
||||
match &*request.current_url().scheme {
|
||||
"about" | "blob" | "data" | "filesystem" => (), // Ok, the URL is local.
|
||||
_ => response = Some(Response::network_error())
|
||||
}
|
||||
}
|
||||
|
||||
// Step 3
|
||||
|
@ -1044,13 +1047,6 @@ fn includes_credentials(url: &Url) -> bool {
|
|||
false
|
||||
}
|
||||
|
||||
fn url_is_local(url: &Url) -> bool {
|
||||
match &*url.scheme {
|
||||
"about" | "blob" | "data" | "filesystem" => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
||||
fn response_needs_revalidation(_response: &Response) -> bool {
|
||||
// TODO this function
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue