mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Create HttpStatus to safely deal with HTTP responses status. (#33581)
Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
013473f1d5
commit
58f34ad7a3
30 changed files with 344 additions and 403 deletions
|
@ -7,7 +7,7 @@ use std::pin::Pin;
|
|||
|
||||
use data_url::DataUrl;
|
||||
use headers::HeaderValue;
|
||||
use http::StatusCode;
|
||||
use net_traits::http_status::HttpStatus;
|
||||
use net_traits::request::Request;
|
||||
use net_traits::response::{Response, ResponseBody};
|
||||
use net_traits::{NetworkError, ResourceFetchTiming};
|
||||
|
@ -40,8 +40,7 @@ impl ProtocolHandler for DataProtocolHander {
|
|||
http::header::CONTENT_TYPE,
|
||||
HeaderValue::from_str(&mime.to_string()).unwrap(),
|
||||
);
|
||||
response.status = Some((StatusCode::OK, "OK".to_string()));
|
||||
response.raw_status = Some((StatusCode::OK.as_u16(), b"OK".to_vec()));
|
||||
response.status = HttpStatus::default();
|
||||
Some(response)
|
||||
},
|
||||
Err(_) => None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue