Skip to content

Commit 2338b38

Browse files
committed
update the faraday connection/response handler to accept non-json responses (read: string)
1 parent 63f4210 commit 2338b38

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/slack/web/faraday/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def connection
2626
connection.request :url_encoded
2727
connection.use ::Slack::Web::Faraday::Response::RaiseError
2828
connection.response :mashify, mash_class: Slack::Messages::Message
29-
connection.response :json, content_type: /\b*$/
29+
connection.response :json, content_type: /\bjson$/
3030
connection.use ::Slack::Web::Faraday::Response::WrapError
3131
connection.response :logger, logger if logger
3232
connection.adapter adapter

lib/slack/web/faraday/response/raise_error.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def on_complete(env)
1010
return unless env.success?
1111

1212
body = env.body
13+
return if env.success? && body.is_a?(String)
1314
return unless body
1415
return if body['ok']
1516

0 commit comments

Comments
 (0)