We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 583382f commit d8caa1cCopy full SHA for d8caa1c
src/web/rustdoc.rs
@@ -635,6 +635,10 @@ pub struct SharedResourceHandler;
635
impl Handler for SharedResourceHandler {
636
fn handle(&self, req: &mut Request) -> IronResult<Response> {
637
let path = req.url.path();
638
+ if path.len() > 1 {
639
+ // All rustdoc shared resources are hosted at the root
640
+ return Err(Nope::ResourceNotFound.into());
641
+ }
642
let filename = path.last().unwrap(); // unwrap is fine: vector is non-empty
643
let suffix = filename.split('.').last().unwrap(); // unwrap is fine: split always works
644
if ["js", "css", "woff", "svg"].contains(&suffix) {
0 commit comments