aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/net
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-06-26 10:02:50 +0200
committerGitHub <noreply@github.com>2024-06-26 08:02:50 +0000
commit7ea894774f3a00a1e31aa22d8862dfb54661e18a (patch)
tree858269f22bc370d3fc52008576c1dda093b2ee94 /components/shared/net
parentb3d99a607fda9511900f2d5e2c81f905802fe758 (diff)
downloadservo-7ea894774f3a00a1e31aa22d8862dfb54661e18a.tar.gz
servo-7ea894774f3a00a1e31aa22d8862dfb54661e18a.zip
Add a directory listing feature for `file` URLs (#32580)
Signed-off-by: Bobulous <Bobulous@users.noreply.github.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Bobulous <Bobulous@users.noreply.github.com>
Diffstat (limited to 'components/shared/net')
-rw-r--r--components/shared/net/request.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/shared/net/request.rs b/components/shared/net/request.rs
index 77b37e17b75..2c644d9ba54 100644
--- a/components/shared/net/request.rs
+++ b/components/shared/net/request.rs
@@ -37,6 +37,12 @@ pub enum Origin {
Origin(ImmutableOrigin),
}
+impl Origin {
+ pub fn is_opaque(&self) -> bool {
+ matches!(self, Origin::Origin(ImmutableOrigin::Opaque(_)))
+ }
+}
+
/// A [referer](https://fetch.spec.whatwg.org/#concept-request-referrer)
#[derive(Clone, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum Referrer {