mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +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>() {
|
if !response.headers.has::<Location>() {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
let location = response.headers.get::<Location>();
|
let location = match response.headers.get::<Location>() {
|
||||||
if location.is_none() {
|
None => return Response::network_error(),
|
||||||
return Response::network_error();
|
Some(location) => location,
|
||||||
}
|
};
|
||||||
// Step 5
|
// Step 5
|
||||||
let locationUrl = Url::parse(location.unwrap());
|
let locationUrl = Url::parse(location);
|
||||||
// Step 6
|
// Step 6
|
||||||
let locationUrl = match locationUrl {
|
let locationUrl = match locationUrl {
|
||||||
Ok(url) => url,
|
Ok(url) => url,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue