SamTV12345 / PodFetch

A sleek and efficient podcast downloader.
https://samtv12345.github.io/PodFetch
Apache License 2.0
347 stars 25 forks source link

Percent sign '%' isn't encoded in URLs #206

Closed mgoral closed 1 year ago

mgoral commented 1 year ago

Describe the bug

I subscribe to "99% Invisible" podcast (oh boy, this one gives me headaches ;)). Unfortunately, PodFetch doesn't encode "%" character in URLs to its cover image with "%25" which results in failing of displaying the cover. (HTTP 400 - Bad Request).

So for example, the URL to the cover is <server-url>/podcasts/99%%20Invisible/image.jpg instead of <server-url>/podcasts/99%25%20Invisible/image.jpg

My PodFetch instance is behind nginx reverse proxy. Mentioning this because nginx reports HTTP 400, not the built-in server.

Reproduction

as above

System Info

Linux, Synology, Firefox, PodFetch in Docker behind nginx reverse proxy

Used Package Manager

n/a

Validations

mgoral commented 1 year ago

This also affects podcast search (Itunes and Podcast Index). With "99% Invisible" spinner just keeps spinning. From the network console, the following request gets HTTP 400:

GET /api/v1/podcasts/1/99%%20Invisible/search HTTP/2
Host: <redacted>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Authorization: Basic <redacted>
Connection: keep-alive
Referer: <redacted>/ui/podcasts
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
DNT: 1
Sec-GPC: 1
Pragma: no-cache
Cache-Control: no-cache
TE: trailers
SamTV12345 commented 1 year ago

Thanks should be fixed now.