We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b5736cd + ed6188b commit bcfc1d5Copy full SHA for bcfc1d5
1 file changed
lib/pusher/webhook.rb
@@ -34,7 +34,10 @@ def initialize(request, client = Pusher)
34
if request.respond_to?(:env) && request.respond_to?(:content_type)
35
@key = request.env['HTTP_X_PUSHER_KEY']
36
@signature = request.env["HTTP_X_PUSHER_SIGNATURE"]
37
- @content_type = request.content_type
+ # Rails 7.1+ changed content_type to return the full header value
38
+ # (e.g. "application/json; charset=utf-8"). Use media_type when
39
+ # available (ActionDispatch::Request) to get just the MIME type.
40
+ @content_type = request.respond_to?(:media_type) ? request.media_type : request.content_type
41
42
request.body.rewind
43
@body = request.body.read
0 commit comments