-
Notifications
You must be signed in to change notification settings - Fork 157
Allow faraday client configuration #138
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
base: master
Are you sure you want to change the base?
Conversation
@@ -202,6 +203,7 @@ def for_uri(uri, extra_headers = {}) | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/SafeNavigation: Use safe navigation (&.) instead of checking if an object exists before calling the method.
@@ -12,10 +12,11 @@ class FCM | |||
INSTANCE_ID_API = "https://iid.googleapis.com" | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
6c647c3
to
efcc76a
Compare
efcc76a
to
94e5da6
Compare
sure. test added, please take a look |
Enable additional configuration of Faraday client, allowing usage of different Faraday middleware.
This PR also partially resolves #59, as it allows configuring retry middleware.