-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid parameter error when calling resize #145
Comments
Hey team! Please add your planning poker estimate with ZenHub @kovshenin @jerico @wisyhambolu |
@ferschubert-hm @mikelittle We have estimated this as a 3, please let us know if anything bothers you |
I tried reproducing the issue with queries like I plan to try again on Monday. @roborourke I would appreciate if you could provide some guidance on how I can reproduce the error. |
Looking at the parameters that can be passed to Sharp's resize method here specifically: https://github.com/humanmade/tachyon/blob/master/index.js#L180-L211 So |
Let's see if I can fix it... Could reproduce it and get a 502 with So crop_strategy should be one of the accepted parameters as well resize values cannot have special chars. |
We have a lot of vulnerabilities and deprecated warnings:
|
In fact the error is thrown for the |
Could reproduce it, if you do not specify one of the 4 params for crop it fails, or if you specifiy a non-int value.
|
I'm not too worried about the vulns / deprecation warnings just yet, those can be handled separately in another issue. These errors are to be expected too if incorrect values are being provided intentionally. Additionally looking at the associated spike - the errors reported there are not really related to what this issue is reporting, those were caused by someone intentionally passing incorrect values to the The API docs already indicate what values are expected or available for each query parameter so I don't think we need to keep trying different combinations of things to work that out, see https://docs.altis-dxp.com/media/dynamic-images/#query-args-reference I think this issue isn't properly scoped yet from when I wrote it originally so here's what I think needs to happen now:
Parameters and accepted value regexes:
|
@roborourke Opted to delete the object key in arg instead if it's not valid. Let me know if this is not a good idea. I adjusted webp's regex to https://github.com/humanmade/tachyon/blob/master/lambda-handler.js#L10-L12 |
Error spotted in some situations when running in lambda:
the code should handle whatever is being passed as an invalid parameter before we call Sharp’s resize function.
Acceptance criteria:
The text was updated successfully, but these errors were encountered: