Skip to content

Commit cc58f8a

Browse files
committed
add test for status on http2
1 parent 7e4daa3 commit cc58f8a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/async/websocket/connect_request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
module Async
1414
module WebSocket
15-
# This is required for HTTP/1.x to upgrade the connection to the WebSocket protocol.
15+
# This is required for HTTP/2 to establish a connection using the WebSocket protocol.
1616
# See https://tools.ietf.org/html/rfc8441 for more details.
1717
class ConnectRequest < ::Protocol::HTTP::Request
1818
include ::Protocol::WebSocket::Headers

test/async/websocket/client.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,15 @@ def valid_headers(request)
185185
with 'http/2' do
186186
let(:protocol) {Async::HTTP::Protocol::HTTP2}
187187
it_behaves_like ClientExamples
188+
189+
with 'invalid status' do
190+
let(:app) do
191+
Protocol::HTTP::Middleware.for do |request|
192+
Protocol::HTTP::Response[403, {}, []]
193+
end
194+
end
195+
196+
it_behaves_like FailedToNegotiate
197+
end
188198
end
189199
end

0 commit comments

Comments
 (0)