Skip to content

Commit 385e465

Browse files
committed
Encode pathname
1 parent 31e3fb0 commit 385e465

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/services/getMediaURI.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ const getMediaURI = (type, id, callback) => {
4949
// encodeURI encodes a fully formed URL and won't encode the slashes
5050
// also use relisten proxy
5151
if (slug === 'wsp') {
52-
trackUrl = trackUrl.replace(
53-
'www.panicstream.com/streams',
54-
'phishin-proxy.relisten.net/panicstream'
52+
const url = new URL(
53+
trackUrl.replace('www.panicstream.com/streams', 'phishin-proxy.relisten.net/panicstream')
5554
);
55+
url.pathname = encodeURIComponent(url.pathname);
56+
trackUrl = url.href;
5657

5758
headers.push({
5859
httpHeader: {

0 commit comments

Comments
 (0)