aboutsummaryrefslogtreecommitdiffstats
path: root/components/net_traits/request.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-06-13 10:01:33 -0400
committerGitHub <noreply@github.com>2020-06-13 10:01:33 -0400
commit581ade575e22a9266fc7b28e45a55aadf725606e (patch)
tree7a8b837e05cc0e4a6df9bcd841437a19c7256e50 /components/net_traits/request.rs
parent2ce4bc5ad6687ad37bd928709eae1be866b5abc8 (diff)
parent63aab1b355d1ae0a40471d4259d5021c5bd02e1b (diff)
downloadservo-581ade575e22a9266fc7b28e45a55aadf725606e.tar.gz
servo-581ade575e22a9266fc7b28e45a55aadf725606e.zip
Auto merge of #26810 - CYBAI:fix-infinite-stream, r=gterzian
Fix infinite stream and its missing incumbent script environment when newing a new stream --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26807 - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___
Diffstat (limited to 'components/net_traits/request.rs')
-rw-r--r--components/net_traits/request.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/components/net_traits/request.rs b/components/net_traits/request.rs
index 27b9274a6dd..f80b82b0fca 100644
--- a/components/net_traits/request.rs
+++ b/components/net_traits/request.rs
@@ -117,7 +117,7 @@ pub enum ParserMetadata {
}
/// <https://fetch.spec.whatwg.org/#concept-body-source>
-#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
+#[derive(Clone, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum BodySource {
Null,
Object,
@@ -178,10 +178,7 @@ impl RequestBody {
}
pub fn source_is_null(&self) -> bool {
- if let BodySource::Null = self.source {
- return true;
- }
- false
+ self.source == BodySource::Null
}
pub fn len(&self) -> Option<usize> {