mirror of
https://github.com/curl/curl.git
synced 2026-07-26 04:07:17 +03:00
test2304: verify websocket handling when connection is closed
This commit is contained in:
parent
b716511f0f
commit
86b4b66c54
4 changed files with 200 additions and 2 deletions
|
|
@ -241,7 +241,7 @@ test2100 \
|
|||
\
|
||||
test2200 test2201 test2202 test2203 test2204 test2205 \
|
||||
\
|
||||
test2300 test2301 test2302 test2303 \
|
||||
test2300 test2301 test2302 test2303 test2304 \
|
||||
\
|
||||
test2500 \
|
||||
\
|
||||
|
|
|
|||
68
tests/data/test2304
Normal file
68
tests/data/test2304
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
WebSockets
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Sends a PING + a 5 byte hello TEXT
|
||||
<reply>
|
||||
<data nocheck="yes" nonewline="yes">
|
||||
HTTP/1.1 101 Switching to WebSockets swsclose
|
||||
Server: test-server/fake
|
||||
Upgrade: websocket
|
||||
Connection: Upgrade
|
||||
Something: else
|
||||
Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs=
|
||||
|
||||
%hex[%89%00%81%05hello]hex%
|
||||
</data>
|
||||
# allow upgrade
|
||||
<servercmd>
|
||||
upgrade
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
# require debug for the forced CURL_ENTROPY
|
||||
<features>
|
||||
debug
|
||||
ws
|
||||
</features>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<name>
|
||||
WebSockets curl_ws_recv() with closed connection
|
||||
</name>
|
||||
<tool>
|
||||
lib%TESTNUMBER
|
||||
</tool>
|
||||
<command>
|
||||
ws://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# PONG with no data and the 32 bit mask
|
||||
#
|
||||
<verify>
|
||||
<protocol nocheck="yes" crlf="yes">
|
||||
GET /%TESTNUMBER HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
User-Agent: websocket/2304
|
||||
Accept: */*
|
||||
Upgrade: websocket
|
||||
Connection: Upgrade
|
||||
Sec-WebSocket-Version: 13
|
||||
Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ==
|
||||
|
||||
</protocol>
|
||||
<stdout mode="text">
|
||||
Connection closed
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue