mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove an unwrap() call in HTTP fetch.
This commit is contained in:
parent
b23f4266ad
commit
4ca6325bad
1 changed files with 5 additions and 5 deletions
|
@ -263,12 +263,12 @@ impl Request {
|
|||
if !response.headers.has::<Location>() {
|
||||
return response;
|
||||
}
|
||||
let location = response.headers.get::<Location>();
|
||||
if location.is_none() {
|
||||
return Response::network_error();
|
||||
}
|
||||
let location = match response.headers.get::<Location>() {
|
||||
None => return Response::network_error(),
|
||||
Some(location) => location,
|
||||
};
|
||||
// Step 5
|
||||
let locationUrl = Url::parse(location.unwrap());
|
||||
let locationUrl = Url::parse(location);
|
||||
// Step 6
|
||||
let locationUrl = match locationUrl {
|
||||
Ok(url) => url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue