mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -340,8 +340,7 @@ impl FetchResponseListener for PosterFrameFetchContext {
|
|||
|
||||
let status_is_ok = metadata
|
||||
.as_ref()
|
||||
.and_then(|m| m.status.as_ref())
|
||||
.map_or(true, |s| s.0 >= 200 && s.0 < 300);
|
||||
.map_or(true, |m| m.status.in_range(200..300));
|
||||
|
||||
if !status_is_ok {
|
||||
self.cancelled = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue