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
Adapter options aren't merged correctly #367
Comments
I would discourage usage of macros for DRY. It's better to use the Runtime middleware. I think On the other hand, currently it doesn't work, and it seems like there is a little chance someone is relying on this behaviour. |
I would like to work on this issue |
Hey @sambhavsaxena, are you still up for this one? |
@teamon if there's no one tackling this, I'd be happy to give it a go. To be clear, the goal would be to merge the adapter options and pass them through properly, right? |
Didn't mean to go over your head @polvalente , I stumbled across this a few weeks ago and decided to try to fix it but hadn't seen your comment. |
No harm done! |
I need to use a proxy server for requests for some services. I created a reusable module for this:
Then I used this module in an API client module where I also needed to add another adapter options:
I believe that Tesla should merge all adapter options, but now it's not.
At first all options are appended to one list:
Then adapter options retrieved using square brackets here:
https://github.com/teamon/tesla/blob/d5ce3a75d7ff285563fdfd47905e66ba4a0433a3/lib/tesla.ex#L215-L220
And we get only the first value in case there are few pairs with the same key in a Keyword.
To solve the issue I suggest to rewrite this function this way:
The text was updated successfully, but these errors were encountered: