Don't strip the prefix from custom assets

This commit is contained in:
Jonathan Kelley committed 2024-01-21 13:38:25 -08:00
1 parent 028f499bf6
commit e9978c119f
2 files changed
+2 -31

No files matched your search

+2 -4
View File
@@ -7,10 +7,8 @@ fn main() {
fn app() -> Element {
use_asset_handler("logos", |request, response| {
// Note that the "logos" prefix is stripped from the URI
//
// However, the asset is absolute to its "virtual folder" - meaning it starts with a leading slash
if request.uri().path() != "/logo.png" {
// We get the original path - make sure you handle that!
if request.uri().path() != "/logos/logo.png" {
return;
}