Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ vfox add nodejs
## Mirror

You can configure the mirror by `VFOX_NODEJS_MIRROR` environment variable. The default value
is `https://nodejs.org/dist/`.
is `https://nodejs.org/dist`. Trailing slashes are automatically handled, so both
`https://nodejs.org/dist` and `https://nodejs.org/dist/` will work correctly.
3 changes: 2 additions & 1 deletion lib/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ function UTIL.getBaseUrl()
if mirror == "" or mirror == nil then
return "https://nodejs.org/dist"
end
return mirror
-- Strip trailing slash to avoid double slashes in URL paths
return mirror:gsub("/$", "")
end

function UTIL.compare_versions(v1o, v2o)
Expand Down