diff --git a/src/satellite/src/storage/routing.rs b/src/satellite/src/storage/routing.rs index 6fe53af54..86607bbc0 100644 --- a/src/satellite/src/storage/routing.rs +++ b/src/satellite/src/storage/routing.rs @@ -28,16 +28,6 @@ pub fn get_routing( let MapUrl { path, token } = map_url(&url)?; - // We return the asset that matches the effective path - let asset: Option<(Asset, Memory)> = get_public_asset(path.clone(), token.clone()); - - match asset { - None => (), - Some(_) => { - return Ok(Routing::Default(RoutingDefault { url: path, asset })); - } - } - // ⚠️ Limitation: requesting an url without extension try to resolve first a corresponding asset // e.g. /.well-known/hello -> try to find /.well-known/hello.html // Therefore if a file without extension is uploaded to the storage, it is important to not upload an .html file with the same name next to it or a folder/index.html @@ -52,6 +42,16 @@ pub fn get_routing( } } + // We return the asset that matches the effective path + let asset: Option<(Asset, Memory)> = get_public_asset(path.clone(), token.clone()); + + match asset { + None => (), + Some(_) => { + return Ok(Routing::Default(RoutingDefault { url: path, asset })); + } + } + if include_alternative_routing { // Search for potential redirect let redirect = get_routing_redirect(&path);