Allow faraday client configuration#138
Conversation
| extra_headers.each do |key, value| | ||
| faraday.headers[key] = value | ||
| end | ||
| @faraday_configurer.call(faraday) if @faraday_configurer |
There was a problem hiding this comment.
Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method.
| TOPIC_REGEX = /[a-zA-Z0-9\-_.~%]+/ | ||
|
|
||
| def initialize(json_key_path = "", project_name = "", http_options = {}) | ||
| def initialize(json_key_path = "", project_name = "", http_options = {}, faraday_configurer = nil) |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [100/80]
|
@sabman can you take a look at this? |
|
Just need to add a test - are you able to do that? |
6c1ed78 to
6c647c3
Compare
efcc76a to
94e5da6
Compare
sure. test added, please take a look |
94e5da6 to
4089ea8
Compare
|
This looks like a useful change @erimicel do you have a view on this? |
Looks like a useful addition, |
| extra_headers.each do |key, value| | ||
| faraday.headers[key] = value | ||
| end | ||
| @faraday_configurer.call(faraday) if @faraday_configurer |
There was a problem hiding this comment.
Nice to have: We can probably move @faraday_configurer&.call(faraday) before faraday.adapter Faraday.default_adapter so users can add request middleware (e.g. faraday.request :retry) without confusing with ordering issues
Enable additional configuration of Faraday client, allowing usage of different Faraday middleware.
This PR also partially resolves #59, as it allows configuring retry middleware.