Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 29752 and 25554 baseUrl slash breaks URL when trying to append query string #29759

Closed
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
6 changes: 3 additions & 3 deletions cli/lib/tasks/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const getProxyForUrlWithNpmConfig = (url) => {
null
}

const getBaseUrl = () => {
const getBaseUrl = (urlPath = '') => {
if (util.getEnv('CYPRESS_DOWNLOAD_MIRROR')) {
let baseUrl = util.getEnv('CYPRESS_DOWNLOAD_MIRROR')

if (!baseUrl.endsWith('/')) {
if (!baseUrl.endsWith('/') && !urlPath.startsWith('?')) {
baseUrl += '/'
}

Expand Down Expand Up @@ -57,7 +57,7 @@ const getCA = () => {
}

const prepend = (arch, urlPath, version) => {
const endpoint = url.resolve(getBaseUrl(), urlPath)
const endpoint = url.resolve(getBaseUrl(urlPath), urlPath)
const platform = os.platform()
const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE', true)

Expand Down
Loading