Skip to content

Commit 39c668f

Browse files
committed
Rack 3 update: Patch RspecApiDocumentation module
1 parent 02a742f commit 39c668f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/support/request_body_patch.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Monkey patch to provide a robust read_request_body helper compatible with Rack 3
2+
# See:
3+
# https://github.com/zipmark/rspec_api_documentation/pull/550
4+
# https://github.com/zipmark/rspec_api_documentation/issues/548
5+
6+
begin
7+
module RspecApiDocumentation
8+
class ClientBase
9+
def read_request_body
10+
input = last_request.env['rack.input'] || StringIO.new
11+
input.rewind
12+
input.read
13+
end
14+
end
15+
end
16+
end
17+

0 commit comments

Comments
 (0)