fix an issues with responding with long strings (#576)

This commit is contained in:
Anton Maminov 2020-07-08 14:41:16 +03:00 committed by GitHub
parent a8c0f09b85
commit 2e749a2987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -10,6 +10,17 @@ describe "Kemal::RouteHandler" do
client_response.body.should eq("hello")
end
it "routes with long response body" do
long_response_body = "string" * 10_000
get "/" do
long_response_body
end
request = HTTP::Request.new("GET", "/")
client_response = call_request_on_app(request)
client_response.body.should eq(long_response_body)
end
it "routes should only return strings" do
get "/" do
100

View file

@ -8,7 +8,7 @@ class HTTP::Server::Response
ensure_headers_written
super
previous_def
end
end
end