Skip to content

Commit 1cbc61f

Browse files
committed
Use standard response handling for Rails.
1 parent f85eb48 commit 1cbc61f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/async/websocket/adapters/rails.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@ module Adapters
1111
module Rails
1212
def self.open(request, **options, &block)
1313
if response = Rack.open(request.env, **options, &block)
14-
response[1]['rack.hijack'] = lambda do |stream|
15-
response[2].call(stream)
16-
end
17-
18-
# Close the response to prevent Rails from... trying to render a view?
19-
return ::ActionDispatch::Response.new(response[0], response[1], nil).tap(&:close)
14+
::Rack::Response[*response]
15+
else
16+
::ActionDispatch::Response.new(404, [], [])
2017
end
21-
22-
return ::ActionDispatch::Response.new(404, [], [])
2318
end
2419
end
2520
end

0 commit comments

Comments
 (0)