LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
12.95k stars 859 forks source link

Image proxy fixes #4871

Open sunaurus opened 1 week ago

sunaurus commented 1 week ago

This fixes two issues with image proxying:

  1. Ensure that the original image url gets written to remote_image, rather than the proxied url). Otherwise, the url validation logic in the image_proxy/ endpoint does not work.
  2. Remove an unnecessary URL decode step in the image_proxy logic. The URLs at this point are already decoded enough, any remaining encoded parts are actually part of the original URL, so decoding them again here will break such URLs (and make the validation fail).