Skip to content

Commit

Permalink
fix(merge-confidence): escape all slashes within a package name (#27873)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Ladzaretti committed Mar 12, 2024
1 parent 30281b7 commit 2b03c2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/util/merge-confidence/index.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 2b03c2c

Please sign in to comment.