Skip to content

Commit

Permalink
Fix URL hashing at the root
Browse files Browse the repository at this point in the history
Changelog: fixed
  • Loading branch information
yorickpeterse committed Jun 10, 2024
1 parent 8595e43 commit 5f4df29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wobsite.inko
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class pub UpdateAssetLinks {
}

fn hashed_url(url: String) -> String {
let key = if url.starts_with?('..') {
let key = if url.starts_with?('/').false? {
relative_to_absolute(@url, url, as_file: true)
} else {
url
Expand Down
1 change: 1 addition & 0 deletions test/test_wobsite.inko
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ fn pub tests(t: mut Tests) {

let assets = UpdateAssetLinks(files: files, url: '/')

t.equal(assets.hashed_url('style.css'), 'style.css?hash=123')
t.equal(assets.hashed_url('/style.css'), '/style.css?hash=123')
t.equal(assets.hashed_url('../style.css'), '../style.css?hash=123')

Expand Down

0 comments on commit 5f4df29

Please sign in to comment.