Skip to content

Commit

Permalink
Set content-length header in the FakeMiddleware
Browse files Browse the repository at this point in the history
Similar change as rails#290
  • Loading branch information
mishina2228 committed Jun 8, 2022
1 parent 3a10411 commit b3cf9cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/web_console/testing/fake_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def initialize(opts)
end

def call(env)
[ 200, @headers, [ render(req_path(env)) ] ]
body = render(req_path(env))
@headers["content-length"] = body.bytesize.to_s

[ 200, @headers, [ body ] ]
end

def view
Expand Down

0 comments on commit b3cf9cf

Please sign in to comment.