Ensure request.body isn't emptied out before signature verification (#10432)

Fixes #10429
This commit is contained in:
ThibG 2019-03-31 17:27:24 +02:00 committed by Eugen Rochko
parent 59cce07601
commit 68c797bece

View file

@ -32,7 +32,10 @@ class ActivityPub::InboxesController < Api::BaseController
end end
def body def body
@body ||= request.body.read.force_encoding('UTF-8') return @body if defined?(@body)
@body = request.body.read.force_encoding('UTF-8')
request.body.rewind if request.body.respond_to?(:rewind)
@body
end end
def upgrade_account def upgrade_account