weserv / images

Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s).
https://wsrv.nl/
BSD 3-Clause "New" or "Revised" License
1.84k stars 187 forks source link

document how to pass in urls with ? / & marks #334

Closed abubelinha closed 3 months ago

abubelinha commented 2 years ago

Original image url (from IIIF server): https://merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi?FIF=PIA03883.pyr.tif&WID=800&CVT=jpeg

I guess this fails because there is a "?" in the original url? https://images.weserv.nl/?url=merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi?FIF=PIA03883.pyr.tif&WID=800&CVT=jpeg

// 20220310130335
// https://images.weserv.nl/?url=merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi?FIF=PIA03883.pyr.tif&WID=800&CVT=jpeg

{
  "status": "error",
  "code": 404,
  "message": "Invalid or unsupported image format. Is it a valid image?"
}
kleisauke commented 2 years ago

Users are expected to URL-encode the given URL, or at least ? to %3F and & to %26, for example: https://images.weserv.nl/?url=merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi%3FFIF=PIA03883.pyr.tif%26WID=800%26CVT=jpeg

abubelinha commented 2 years ago

Great!! I was suspecting something like this, but I asked because I couldn't find it in the FAQ/docs. Now I see other similar issues (#220, #175, ...)

I suggest adding it to FAQs or as a note next to the main example in docs.

kleisauke commented 2 years ago

Indeed, we should probably note this in the docs.

abubelinha commented 2 years ago

I edited the title and reopen the issue as a reminder of adding this to docs. Feel free to close it if you prefer.

kleisauke commented 3 months ago

Documentation has been updated to note this. https://wsrv.nl/docs/introduction.html#how-it-works