Topic: [Bug] InvalidURIError when upload URL contains [ or ]

Posted under Site Bug Reports & Feature Requests

Bug overview description.
I tried to upload the following Fur Affinity post with https://e621.net/uploads/new
by putting the direct image link in the "(or) URL:" field

https://www.furaffinity.net/user/seasonalfungi/
https://www.furaffinity.net/view/46119585/
https://d.furaffinity.net/art/seasonalfungi/1645787672/1645787196.seasonalfungi_wolf_milk_farm_[25-02-2022].png

What part(s) of the site page(s) are affected?
https://e621.net/uploads/new

What is the expected behavior?
The FA post should've been uploaded.
It works if I upload the image from my hard disk instead of the direct image link.

What actual behavior is given instead?
e621 displayed this error message:

error: URI::InvalidURIError - bad URI(is not URI?):"https://d.furaffinity.net/art/seasonalfungi/1645787672/1645787196.seasonalfungi_wolf_milk_farm_[25-02-2022].png?danbooru_no_cache=c4153877-dd17-453d-9f72-e1b001ac7d70" 

Time of incident (if applicable).
A few minutes ago.

Can you reproduce the bug every time?
Not with the same post, obviously...
But I get the same error message, including the "?danbooru_no_cache=" query string, but with a different GUID, with:

https://www.furaffinity.net/user/seasonalfungi/
https://www.furaffinity.net/view/45711985/
https://d.furaffinity.net/art/seasonalfungi/1643461067/1643461047.seasonalfungi_harness_[29-02-2022].png

What steps did you take to replicate this bug?
See above.

Errors or other messages returned (if any).
See above.

Updated

It's an annoying bug with FA, reported something similar years ago (see topic #17341).
It only affects specific links and you will know it when clicking on the direct link returns a "403 Forbidden" error.

thegreatwolfgang said:
It's an annoying bug with FA, reported something similar years ago (see topic #17341).
It only affects specific links and you will know it when clicking on the direct link returns a "403 Forbidden" error.

There are no errors when I click on Download in seasonalfungi's posts.
So it must be a different bug.

mantikor said:
There are no errors when I click on Download in seasonalfungi's posts.
So it must be a different bug.

Maybe, the link still throws up a 403 Forbidden error when you click on the direct link and not through the Download button on the source post.
If you used the Download button, it will fix the issue temporarily.

I suspect the server is trying to access the link but encounters this error instead.

Try clicking on this direct link on comment #6049802 to see if it throws up an error.

thegreatwolfgang said:
It's an annoying bug with FA, reported something similar years ago (see topic #17341).
It only affects specific links and you will know it when clicking on the direct link returns a "403 Forbidden" error.

That's a different issue. This bug is because the URL contains [ and ] characters, which aren't encoded properly to be a URL. [ and ] (along with many others) are invalid as URL characters, they need to be encoded as %5B and %5D. Browsers will tend to encode/decode URLs automatically so you'll see and be able to use and copy the plain characters [ and ], but the upload form here doesn't properly convert them and fails with them (e.g. https://d.furaffinity.net/art/seasonalfungi/1643461067/1643461047.seasonalfungi_harness_%5B29-02-2022%5D.png works just fine, for both browsers and the upload form; but using [ and ] will cause the upload form to error).

watsit said:
That's a different issue. This bug is because the URL contains [ and ] characters, which aren't encoded properly to be a URL. [ and ] (along with many others) are invalid as URL characters, they need to be encoded as %5B and %5D. Browsers will tend to encode/decode URLs automatically so you'll see and be able to use and copy the plain characters [ and ], but the upload form here doesn't properly convert them and fails with them (e.g. https://d.furaffinity.net/art/seasonalfungi/1643461067/1643461047.seasonalfungi_harness_%5B29-02-2022%5D.png works just fine, for both browsers and the upload form; but using [ and ] will cause the upload form to error).

Hmm, interesting. I thought this error had been fixed?
I have only encountered encoding errors back when URLs contained Cyrillic characters, but that issue has been fixed on e6 as far as I have seen.

  • 1