0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore: encode parts of URL (#4922)

This commit is contained in:
Marc Bernard 2024-11-02 05:31:21 -04:00 committed by GitHub
parent fa22fa340d
commit e3c55f008c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'verdaccio': patch
---
chore: encode parts of URL

View file

@ -216,7 +216,7 @@ export class ServerQuery {
*/ */
public removePackage(name: string, rev) { public removePackage(name: string, rev) {
return this.request({ return this.request({
uri: `/${encodeURIComponent(name)}/-rev/${rev}`, uri: `/${encodeURIComponent(name)}/-rev/${encodeURIComponent(rev)}`,
method: 'DELETE', method: 'DELETE',
headers: { headers: {
[HEADERS.CONTENT_TYPE]: HEADERS.JSON_CHARSET, [HEADERS.CONTENT_TYPE]: HEADERS.JSON_CHARSET,
@ -226,7 +226,7 @@ export class ServerQuery {
public removeSingleTarball(name: string, filename: string) { public removeSingleTarball(name: string, filename: string) {
return this.request({ return this.request({
uri: `/${encodeURIComponent(name)}/-/${filename}/-rev/whatever`, uri: `/${encodeURIComponent(name)}/-/${encodeURIComponent(filename)}/-rev/whatever`,
method: 'DELETE', method: 'DELETE',
headers: { headers: {
[HEADERS.CONTENT_TYPE]: HEADERS.JSON_CHARSET, [HEADERS.CONTENT_TYPE]: HEADERS.JSON_CHARSET,