From 713676e2bc939d8774f7b9d7a3c047a4fa286e3b Mon Sep 17 00:00:00 2001 From: Gabriel Ladzaretti Date: Tue, 12 Mar 2024 12:13:19 +0200 Subject: [PATCH] escape all slashes --- lib/util/merge-confidence/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util/merge-confidence/index.ts b/lib/util/merge-confidence/index.ts index 56f2f177a52870..26be764a898d8c 100644 --- a/lib/util/merge-confidence/index.ts +++ b/lib/util/merge-confidence/index.ts @@ -7,6 +7,7 @@ import * as packageCache from '../cache/package'; import { parseJson } from '../common'; import * as hostRules from '../host-rules'; import { Http } from '../http'; +import { regEx } from '../regex'; import { ensureTrailingSlash, joinUrlParts } from '../url'; import { MERGE_CONFIDENCE } from './common'; import type { MergeConfidence } from './types'; @@ -164,7 +165,7 @@ async function queryApi( return 'neutral'; } - const escapedPackageName = packageName.replace('/', '%2f'); + const escapedPackageName = packageName.replace(regEx(/\//g), '%2f'); const url = joinUrlParts( apiBaseUrl, 'api/mc/json',