Skip to content

Commit bf4138c

Browse files
committed
if block
1 parent f5a2b7d commit bf4138c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/slack/web/faraday/connection.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ def create_connection(expect_json_response: true)
1919
::Faraday::Connection.new(endpoint, options) do |connection|
2020
connection.request :multipart
2121
connection.request :url_encoded
22-
connection.use ::Slack::Web::Faraday::Response::RaiseError if expect_json_response
2322
connection.response :mashify, mash_class: Slack::Messages::Message
24-
connection.response :json, content_type: /\b*$/ if expect_json_response
2523
connection.use ::Slack::Web::Faraday::Response::WrapError
2624
connection.response :logger, logger if logger
2725
connection.adapter adapter
26+
27+
if expect_json_response
28+
connection.use ::Slack::Web::Faraday::Response::RaiseError
29+
connection.response :json, content_type: /\b*$/
30+
end
2831
end
2932
end
3033

0 commit comments

Comments
 (0)