test2722 (1228B)
1 <testcase> 2 <info> 3 <keywords> 4 WebSockets 5 </keywords> 6 </info> 7 8 <client> 9 <name> 10 ws: Invalid fragmented message without initial frame 11 </name> 12 <features> 13 Debug 14 ws 15 </features> 16 <server> 17 http 18 </server> 19 <tool> 20 lib2700 21 </tool> 22 <command> 23 ws://%HOSTIP:%HTTPPORT/%TESTNUMBER 24 </command> 25 <setenv> 26 CURL_WS_FORCE_ZERO_MASK=1 27 </setenv> 28 </client> 29 30 <reply> 31 <servercmd> 32 upgrade 33 </servercmd> 34 35 # Full list of frames: see <verify.stdout> below 36 # First a valid BINARY frame 37 # Second a fragmented message with the first frame missing 38 <data nocheck="yes" nonewline="yes"> 39 HTTP/1.1 101 Switching to WebSockets 40 Server: server/%TESTNUMBER 41 Upgrade: Websocket 42 Connection: Upgrade 43 Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= 44 45 %hex[%82%01b]hex%%hex[%00%02m2]hex%%hex[%80%02m3]hex% 46 </data> 47 </reply> 48 49 <verify> 50 51 # Echo of reply data with additional masking up to the missing initial frame 52 <protocol nonewline="yes"> 53 %hex[%82%81%00%00%00%00b]hex% 54 </protocol> 55 56 # Only frames up to the missing initial frame 57 <stdout> 58 bin fin [1] b 59 </stdout> 60 61 # CURLE_RECV_ERROR 62 <errorcode> 63 56 64 </errorcode> 65 66 # Strip HTTP header from <protocol> 67 <strip> 68 ^GET /.* 69 ^(Host|User-Agent|Accept|Upgrade|Connection|Sec-WebSocket-(Version|Key)): .* 70 ^\s*$ 71 </strip> 72 </verify> 73 </testcase>