FreshRSS / FreshRSS

A free, self-hostable news aggregator…
https://freshrss.org
GNU Affero General Public License v3.0
9.6k stars 821 forks source link

[Bug] "&" is being converted to "&" and breaking the url #6575

Closed TatoTech closed 3 months ago

TatoTech commented 3 months ago

Describe the bug

The ampersands within a Last.fm API url are being converted/expanded to & causing FreshRSS to fail as the URL doesn't actually exist.

For example:

I'll enter https://ws.audioscrobbler.com/2.0/?api_key=[REDACTED]&method=user.getrecenttracks&user=rj&format=json&limit=10&extended=1 and it will be changed to https://ws.audioscrobbler.com/2.0/?api_key=[REDACTED]&method=user.getrecenttracks&user=rj&format=json&limit=10&extended=1 which is apparently invalid.

This does not happen with other URL's I've used as sources.

To Reproduce

  1. Go to 'Add a new subsciption'
  2. Paste feed URL into Feed URL textbox
  3. Click 'Type of feed source' and change to JSON (dot notation)
  4. Configure dot notation accordingly
  5. Click 'Add'
  6. Update the feed
  7. Log files show JSON dot notation parsing failed for [https://ws.audioscrobbler.com/2.0/?api_key=[REDACTED]&method=user.getrecenttracks&user=rj&format=json&limit=10&extended=1]

Expected behavior

It should not convert & to & in order for FreshRSS to access the URL correctly.

FreshRSS version

1.24.1

Environment information

Additional context

API docs are here API key its self is a 32 character alphanumeric string

Alkarex commented 3 months ago

I believe the bug is only in the logs (wrongly double escaping the URL) and not in the actual request. The most likely is that the JSON dot notation was wrong

TatoTech commented 3 months ago

Yep that was the issue.

Thanks for the help!