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.86k stars 187 forks source link

Check accepted user-agent content types #321

Closed gradyskyi closed 2 years ago

gradyskyi commented 2 years ago

Great service! It would be wonderful to add some optional parameter, witch will check acceptable user-agent content types for format converting. So if I set "&output=webp&accept=true", for example, service will check Accept user-agent header for webp format, and if user-agent doesn't support requested format, service will ignore output=webp parameter. Thanks!

kleisauke commented 2 years ago

Due to Cloudflare's caching it's technically impossible to change the output depending on the type browser. Please use the <picture>-tag as explained in https://github.com/weserv/images/issues/214.