Skip to content

Commit

Permalink
Register json middleware correctly (#1331)
Browse files Browse the repository at this point in the history
  • Loading branch information
mollerhoj authored Oct 8, 2021
1 parent 506e97a commit 5366029
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/faraday/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def to_env(connection)

require 'faraday/request/authorization'
require 'faraday/request/instrumentation'
require 'faraday/request/json'
require 'faraday/request/multipart'
require 'faraday/request/retry'
require 'faraday/request/url_encoded'
2 changes: 2 additions & 0 deletions lib/faraday/request/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ def request_type(env)
end
end
end

Faraday::Request.register_middleware(json: Faraday::Request::Json)
1 change: 1 addition & 0 deletions lib/faraday/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ def apply_request(request_env)
end
end

require 'faraday/response/json'
require 'faraday/response/logger'
require 'faraday/response/raise_error'
2 changes: 2 additions & 0 deletions lib/faraday/response/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ def response_type(env)
end
end
end

Faraday::Response.register_middleware(json: Faraday::Response::Json)

0 comments on commit 5366029

Please sign in to comment.