Skip to content

Commit

Permalink
Restore support for full hijack.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Dec 11, 2023
1 parent 4a6a4b8 commit 2d97662
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/protocol/rack/adapter/generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def unwrap_request(request, env)
env[CGI::HTTP_UPGRADE] = Array(protocol).join(",")
end

if request.respond_to?(:hijack?) and request.hijack?
env[RACK_HIJACK] = proc{request.hijack!.io.dup}
end

# HTTP/2 prefers `:authority` over `host`, so we do this for backwards compatibility.
env[CGI::HTTP_HOST] ||= request.authority

Expand Down

0 comments on commit 2d97662

Please sign in to comment.