mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Review fixes
This commit is contained in:
parent
8b9479f8bf
commit
9deecd793c
11 changed files with 44 additions and 549 deletions
|
@ -226,9 +226,13 @@ impl Response {
|
|||
let mut metadata = if let Some(ref url) = self.url {
|
||||
Metadata::default(url.clone())
|
||||
} else {
|
||||
return Err(NetworkError::Internal("No url found".to_string()));
|
||||
return Err(NetworkError::Internal("No url found in response".to_string()));
|
||||
};
|
||||
|
||||
if self.is_network_error() {
|
||||
return Err(NetworkError::Internal("Cannot extract metadata from network error".to_string()));
|
||||
}
|
||||
|
||||
metadata.set_content_type(match self.headers.get() {
|
||||
Some(&ContentType(ref mime)) => Some(mime),
|
||||
None => None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue