diff options
author | ThibG <thib@sitedethib.com> | 2019-03-31 17:27:24 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-31 17:27:24 +0200 |
commit | 68c797bece0ed0801cfc8718d77841b455bf4d0d (patch) | |
tree | e7e3d656684215c20d9824d013218b3b48f9e289 /app | |
parent | 59cce07601cbac40c8e6f5af593ea957a57d209f (diff) |
Ensure request.body isn't emptied out before signature verification (#10432)
Fixes #10429
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/activitypub/inboxes_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/activitypub/inboxes_controller.rb b/app/controllers/activitypub/inboxes_controller.rb index 1501b914e..a0b7532c2 100644 --- a/app/controllers/activitypub/inboxes_controller.rb +++ b/app/controllers/activitypub/inboxes_controller.rb @@ -32,7 +32,10 @@ class ActivityPub::InboxesController < Api::BaseController end 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 def upgrade_account |