imaginary
imaginary copied to clipboard
handling urls encoded with url.QueryUnescape
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