From 1c2d3566963a76b37537cd2964246842ba962847 Mon Sep 17 00:00:00 2001 From: angrynode Date: Sat, 15 Nov 2025 12:04:50 +0100 Subject: [PATCH] feat: Allow unknown extensions in static assets --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 261f3e8..236277f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3360,7 +3360,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static-serve" version = "0.4.0" -source = "git+https://github.com/angrynode/static-serve?branch=infallible-mimetype#51b54e3b82d0f781fe58a7337f7a8ca307e55568" +source = "git+https://github.com/M4SS-Code/static-serve#33ebf1892a8d68e0aacbee0b32b1296e6fe4eebb" dependencies = [ "axum", "bytes", @@ -3370,7 +3370,7 @@ dependencies = [ [[package]] name = "static-serve-macro" version = "0.4.0" -source = "git+https://github.com/angrynode/static-serve?branch=infallible-mimetype#51b54e3b82d0f781fe58a7337f7a8ca307e55568" +source = "git+https://github.com/M4SS-Code/static-serve#33ebf1892a8d68e0aacbee0b32b1296e6fe4eebb" dependencies = [ "display_full_error", "flate2", diff --git a/Cargo.toml b/Cargo.toml index aef12c0..41543c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,9 +49,9 @@ serde_json = { version = "1" } # Error declaration/context snafu = "0.8.8" # Serve static assets directly from the binary -# Wait for https://github.com/M4SS-Code/static-serve/pull/8 +# Using dev branch because of: https://github.com/M4SS-Code/static-serve/pull/8 # static-serve = "0.3.0" -static-serve = { git = "https://github.com/angrynode/static-serve", branch = "infallible-mimetype", features = [ "infallible" ] } +static-serve = { git = "https://github.com/M4SS-Code/static-serve" } # Extra tokio features: # fs: Filesystem IO integration # rt: Single-threaded runtime diff --git a/src/lib.rs b/src/lib.rs index 7ff6d40..3b4a94e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ use state::error::AppStateError; pub fn router(state: state::AppState) -> Router { // Embed the assets in the binary, generating the static_router function - embed_assets!("assets"); + embed_assets!("assets", allow_unknown_extensions = true); Router::new() // Register dynamic routes