Skip to content

Commit 32f01ba

Browse files
authored
Rewind request.body only when possible (#719)
`request.body` is now `Rackup::Handler::WEBrick::Input` which does not respond to `:rewind` method.
1 parent b64e648 commit 32f01ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/jekyll-admin/server.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ def document_body
8181

8282
def request_body
8383
@request_body ||= begin
84-
request.body.rewind
85-
request.body.read
84+
rq_bdy = request.body
85+
rq_bdy.rewind if rq_bdy.respond_to?(:rewind)
86+
rq_bdy.read
8687
end
8788
end
8889

0 commit comments

Comments
 (0)