Skip to content

Commit

Permalink
Count .png and .woff2 as shared files
Browse files Browse the repository at this point in the history
These used to be served by the database handler. Now that it no longer
exists, handle them in the shared resource handler directly.
  • Loading branch information
jyn514 committed Mar 23, 2021
1 parent 2f3e356 commit ac37c2c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/web/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,10 @@ impl Handler for SharedResourceHandler {
let path = req.url.path();
let filename = path.last().unwrap(); // unwrap is fine: vector is non-empty
if let Some(extension) = Path::new(filename).extension() {
if ["js", "css", "woff", "svg"].iter().any(|s| *s == extension) {
if ["js", "css", "woff", "woff2", "svg", "png"]
.iter()
.any(|s| *s == extension)
{
let storage = extension!(req, Storage);
let config = extension!(req, Config);

Expand Down

0 comments on commit ac37c2c

Please sign in to comment.