Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/datastar/async_executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def initialize

def new_queue = Async::Queue.new

def prepare(response); end
def prepare(response)
response.delete_header 'Connection'
end

def spawn(&block)
Async(&block)
Expand Down
10 changes: 10 additions & 0 deletions spec/async_executor_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

RSpec.describe Datastar::AsyncExecutor do
it 'removes Connection header from response' do
executor = described_class.new
response = Rack::Response.new(nil, 200, { 'Connection' => 'keep-alive'})
executor.prepare(response)
expect(response.headers.key?('Connection')).to be(false)
end
end