URL rewrite not working for us - adding unsafe to the url?
See original GitHub issueHi,
We are using the serverless image resizer in a new project and also looking to bring it into an old project. However, we want to use a similar URL to how we used to do image resizing on the server which was like.
/AUS/image001.jpg?h=400&w=400
In the image resizer for the serverless URL this needs to be…
/fit-in/400x400/AUS/image001.jpg
We have come up with the following Regexp for Python as per the docs https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/appendix-b.html
[(r'^([\w\./]+)\?h=([\d]+)&w=([\d]+)$', r'/fit-in/\2x\3\1'),(r'^([\w\./]+)\?w=([\d]+)&h=([\d]+)$', r'/fit-in/\3x\2\1')]
However, this is never resizing the image and in the cloudwatch logs we are getting logs like the following.
[INFO] 2018-09-20T08:40:47.149Z dd22ee1e-bcb0-11e8-8346-6fbe28a7c414 200 GET /unsafe/AUS/image001.jpg (0.0.0.0) 961.66ms
The URL in the log obviously doesn’t have the ‘/fit-in/400x400’ and ‘/unsafe’ is added to the URL.
If anyone could help here that would be fantastic. The lambda function was deployed using the cloud formation template and has not been modified. We have specified in the environment variables for the lambda function that rewrite is enabled and the rewrite pattern above.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (6 by maintainers)
Top GitHub Comments
@razor-x thanks for raising the concern, please allow us sometime to address it.
resolving this as #67 is a separate issue