diff --git a/.changeset/rude-birds-design.md b/.changeset/rude-birds-design.md new file mode 100644 index 000000000..5dd94d444 --- /dev/null +++ b/.changeset/rude-birds-design.md @@ -0,0 +1,5 @@ +--- +'verdaccio': patch +--- + +chore: encode parts of URL diff --git a/packages/verdaccio/src/server/request.ts b/packages/verdaccio/src/server/request.ts index 93df9e7f9..647ecf2c1 100644 --- a/packages/verdaccio/src/server/request.ts +++ b/packages/verdaccio/src/server/request.ts @@ -216,7 +216,7 @@ export class ServerQuery { */ public removePackage(name: string, rev) { return this.request({ - uri: `/${encodeURIComponent(name)}/-rev/${rev}`, + uri: `/${encodeURIComponent(name)}/-rev/${encodeURIComponent(rev)}`, method: 'DELETE', headers: { [HEADERS.CONTENT_TYPE]: HEADERS.JSON_CHARSET, @@ -226,7 +226,7 @@ export class ServerQuery { public removeSingleTarball(name: string, filename: string) { return this.request({ - uri: `/${encodeURIComponent(name)}/-/${filename}/-rev/whatever`, + uri: `/${encodeURIComponent(name)}/-/${encodeURIComponent(filename)}/-rev/whatever`, method: 'DELETE', headers: { [HEADERS.CONTENT_TYPE]: HEADERS.JSON_CHARSET,