h2non / imaginary

Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
https://fly.io/docs/app-guides/run-a-global-image-service/
MIT License
5.55k stars 456 forks source link

handling urls encoded with url.QueryUnescape #370

Closed slav123 closed 10 months ago

slav123 commented 3 years ago

I had an issue where imaginary couldn't properly download images living in AWS S3 bucket, and they were signed. I figure out that we can just use url.QueryEscape to encode them, and then Unescape them during the process later on.

So with this change you can pass url like these https%3A%2F%2Fbucket.s3-accelerate.amazonaws.com%2F1%2F1.jpg%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Credential%3xxx%252F20210903%252Feu-central-1%252Fs3%252Faws4_request%26X-Amz-Date%3D20210903T192653Z%26X-Amz-Expires%3D3600%26X-Amz-SignedHeaders%3Dhost%26x-id%3DGetObject%26X-Amz-Signature%3zzz

h2non commented 10 months ago

Fixed via #414