From 7d5f5437490e802538d8a52e16fae6bb03944eba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 09:40:28 +0000 Subject: [PATCH 1/2] Initial plan From dbad24286ac10245e5767a65ffcbef0a17e80774 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 09:43:58 +0000 Subject: [PATCH 2/2] Fix trailing slash issue in VFOX_NODEJS_MIRROR URL handling Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com> --- README.md | 3 ++- lib/util.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e1257b..0b173ac 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lib/util.lua b/lib/util.lua index 0c09de2..c063c13 100644 --- a/lib/util.lua +++ b/lib/util.lua @@ -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)