mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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>
This commit is contained in:
parent
b3d99a607f
commit
7ea894774f
14 changed files with 291 additions and 11 deletions
|
@ -71,6 +71,7 @@ pub enum Resource {
|
|||
MediaControlsCSS,
|
||||
MediaControlsJS,
|
||||
CrashHTML,
|
||||
DirectoryListingHTML,
|
||||
}
|
||||
|
||||
impl Resource {
|
||||
|
@ -90,6 +91,7 @@ impl Resource {
|
|||
Resource::MediaControlsCSS => "media-controls.css",
|
||||
Resource::MediaControlsJS => "media-controls.js",
|
||||
Resource::CrashHTML => "crash.html",
|
||||
Resource::DirectoryListingHTML => "directory-listing.html",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -146,6 +148,9 @@ fn resources_for_tests() -> Box<dyn ResourceReaderMethods + Sync + Send> {
|
|||
&include_bytes!("../../../resources/media-controls.js")[..]
|
||||
},
|
||||
Resource::CrashHTML => &include_bytes!("../../../resources/crash.html")[..],
|
||||
Resource::DirectoryListingHTML => {
|
||||
&include_bytes!("../../../resources/directory-listing.html")[..]
|
||||
},
|
||||
}
|
||||
.to_owned()
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue