Skip to content

Commit bb07ed8

Browse files
authored
Merge pull request #93 from nsmmrs/faraday-fix
Address `Faraday::Connection#authorization` deprecation warning
2 parents 3cd0c32 + db78807 commit bb07ed8

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/dropbox_api/connection_builder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def build(url)
4747
namespace_id: self.namespace_id
4848
}
4949
middleware.apply(connection) do
50-
connection.authorization :Bearer, bearer
50+
connection.request :authorization, :Bearer, bearer
5151
yield connection
5252
end
5353
end

lib/dropbox_api/endpoints/rpc_notify.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module DropboxApi::Endpoints
33
class RpcNotify < DropboxApi::Endpoints::Rpc
44
def build_connection
55
@connection = @builder.build('https://notify.dropboxapi.com') do |c|
6-
c.headers.delete 'Authorization'
6+
c.builder.handlers.delete(Faraday::Request::Authorization)
77

88
c.response :decode_result
99
end

spec/client_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module DropboxApi
2727
[
2828
DropboxApi::MiddleWare::PathRoot,
2929
MiddlewareStart,
30+
Faraday::Request::Authorization,
3031
MiddlewareMiddle,
3132
MiddlewareEnd
3233
],

0 commit comments

Comments
 (0)