Closed rocket-turtle closed 2 years ago
Thanks for reporting this @rocket-turtle, I'm taking a look 👍
For starters, I can now tell why this was not captured by tests:
# this works as expected
save_response(env, 200, 'test', {'test' => 'test'})
# this raises an unknown keyword: :test error
save_response(env, 200, 'test', {test: 'test'})
It turns out, Ruby 2.7 will attempt to use the last hash argument as kwargs
only if the keys are symbols
I've merged a fix and will soon release this as v2.5.2 👍
Thank you for the fast fix.
It turns out, Ruby 2.7 will attempt to use the last hash argument as
kwargs
only if the keys are symbols
That is interesting. Lets hope no other Adapter uses save_response with a Symbole Hash
I actually checked all the known adapters (at least those documented in awesome-faraday), and since they all support the reason_phrase
, they should all be unaffected 👍 (as reason_phrase
will act as a separator between headers and kwargs)
Basic Info
Issue description
With the new Version I get an ruby deprecation and my test is failing:
I think the Problem is that https://github.com/lostisland/faraday/commit/6799f5852d31dae32699949790633c68282ab71d added an keyword parameter to save_response and now the headers from lib/faraday/adapter.rb:62 are splitted into the arguments and cause the Problem.
Steps to reproduce
I do not know why the tests for the Adapter do not show the same error. I can investigate further if you can not reproduce the error.