Skip to content

Commit 63f4210

Browse files
committed
update the faraday requst logic so that non-json (e.g. string) content can be sent
1 parent 2b3810a commit 63f4210

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/slack/web/faraday/request.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ def request(method, path, options)
2828
request.url(path, options)
2929
when :post, :put
3030
request.path = path
31-
options.compact!
31+
options.compact! unless options.is_a? String
3232
request.body = options unless options.empty?
3333
end
3434
request.headers['Authorization'] = "Bearer #{token}" if token
35-
request.options.merge!(options.delete(:request)) if options.key?(:request)
35+
36+
request.options.merge!(options.delete(:request)) if !options.is_a?(String) && options.key?(:request)
3637
end
3738
response.body
3839
rescue ::Faraday::ParsingError => e

0 commit comments

Comments
 (0)