Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/netbox_client_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ module NetboxClientRuby
setting :adapter, :net_http
setting :logger
setting :request_options, open_timeout: 1, timeout: 5
setting :ssl
end
end
3 changes: 2 additions & 1 deletion lib/netbox_client_ruby/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def self.netbox_config
faraday.request request_encoding
faraday.response config.faraday.logger if config.faraday.logger
faraday.response :json, content_type: /\bjson$/
faraday.options.merge NetboxClientRuby.config.faraday.request_options
faraday.options.merge! NetboxClientRuby.config.faraday.request_options
faraday.ssl.merge! NetboxClientRuby.config.faraday.ssl
faraday.options.params_encoder = Faraday::FlatParamsEncoder
faraday.adapter config.faraday.adapter || Faraday.default_adapter
end
Expand Down
4 changes: 4 additions & 0 deletions spec/netbox_client_ruby/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
config.netbox.api_base_url = 'https://netbox.test/api/'
config.faraday.adapter = :net_http
config.faraday.logger = nil
config.faraday.request_options = {}
config.faraday.ssl = {}
end
end

Expand Down Expand Up @@ -61,6 +63,7 @@
config.netbox.auth.token = '2e35594ec8710e9922d14365a1ea66f27ea69450'
config.netbox.api_base_url = 'https://netbox.test/api/'
config.faraday.adapter = :net_http_persistent
config.faraday.ssl = {}
end
end

Expand All @@ -78,6 +81,7 @@
config.netbox.api_base_url = 'https://netbox.test/api/'
config.faraday.logger = :logger
config.faraday.adapter = :net_http
config.faraday.ssl = {}
end
end

Expand Down