Skip to content

Commit

Permalink
fix: fix WASM asset loading when base url doesn't end in a /. (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag authored Oct 15, 2023
1 parent 92a4c12 commit 5084033
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framework_crates/bones_asset/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ pub struct WebAssetIo {
impl WebAssetIo {
/// Create a new [`WebAssetIo`] with the given URL as the core pack root URL.
pub fn new(asset_url: &str) -> Self {
Self {
asset_url: asset_url.into(),
let mut asset_url = asset_url.to_string();
if !asset_url.ends_with('/') {
asset_url.push('/');
}
Self { asset_url }
}
}

Expand Down

0 comments on commit 5084033

Please sign in to comment.