mgomes / api_auth

HMAC authentication for Rails and HTTP Clients
MIT License
480 stars 147 forks source link

Fix HTTP request driver #173

Closed tycooon closed 5 years ago

tycooon commented 5 years ago

Fixes the NoMethodError: undefined method `fetch_headers' for #<ApiAuth::RequestDrivers::HttpRequest which was introduced in 2.3.0 release. I also added specs for fetch_headers method and you can see that the result hash format is different for each request driver, so that feature might not work as expected at least for some providers.

tycooon commented 5 years ago

@mgomes could you take a look please?

mgomes commented 5 years ago

@tycooon what do you mean by the result hash format being different by provider? Do you mean the key is sometimes not capitalized and/or uses underscores instead of dashes?

tycooon commented 5 years ago

Yep, that's what I mean :)

mgomes commented 5 years ago

@tycooon Ah ok. I was worried we were returning a completely different object. I think it's ok since we're basically just returning the first header that matches our search pattern. But this could definitely be cleaned up in a future release.

Thanks again for a great PR. 🙌🏻