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
Warning when specifiying custom middleware list #706
Comments
One suggestion I have is to add default middleware parameters to the default validation list. valid_middleware_keys(middlewares) + Excon::VALID_CONNECTION_KEYS + Excon::DEFAULT_MIDDLEWARE_PARAMETER_KEYS |
Thanks for the heads up. I suspect a better fix might be that just as middlewares inject valid keys when they are included, that they would also inject defaults for themself? This seems a bit more complicated, but also more future proof/extensible. What do you think? |
@geemus default values for middleware keys seem like a great approach! Given that |
This issue has been automatically marked stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions. |
Pinned, I do intend to circle back to this at some point, just haven't been able to make it a priority. |
While writing test for an excon middleware, I came across this warning:
This warning can be reproduced with the following snippet:
This warning is issued because the list of middlewares I provided to excon is a subset of
Excon.defaults[:middlewares]
, andExcon.defaults
includes:idempotent
,:instrumentor_name
,:mock
,:retry_errors
, and:retry_limit
as default parameters. Because their respective middlewares are not registered, excon thinks these are extraneous parameters.Here's the line responsible for this validation.
The text was updated successfully, but these errors were encountered: