1 <testcase> 2 <info> 3 <keywords> 4 HTTP 5 binary-stdout 6 </keywords> 7 </info> 8 9 <reply> 10 <real_data> 11 HTTP/1.1 200 OK 12 Date: Thu, 09 Nov 2010 14:49:00 GMT 13 Server: test-server/fake 14 Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT 15 ETag: 21025-dc7-39462498 16 Accept-Ranges: bytes 17 Content-Length: 5 18 Connection: close 19 Content-Type: text/html 20 Funny-head: yesyes 21 22 1234 23 </real_data> 24 25 # Provided as base64 encoded to get the binary zero in the body treated 26 # properly. Tricky to generate correctly. 27 <data base64="yes" nocheck="yes"> 28 SFRUUC8xLjEgMjAwIE9LCkRhdGU6IFRodSwgMDkgTm92IDIwMTAgMTQ6NDk6MDAgR01UClNlcnZl 29 cjogdGVzdC1zZXJ2ZXIvZmFrZQpMYXN0LU1vZGlmaWVkOiBUdWUsIDEzIEp1biAyMDAwIDEyOjEw 30 OjAwIEdNVApFVGFnOiAyMTAyNS1kYzctMzk0NjI0OTgKQWNjZXB0LVJhbmdlczogYnl0ZXMKQ29u 31 dGVudC1MZW5ndGg6IDUKQ29ubmVjdGlvbjogY2xvc2UKQ29udGVudC1UeXBlOiB0ZXh0L2h0bWwK 32 RnVubnktaGVhZDogeWVzeWVzCgoAMTIzNA== 33 </data> 34 </reply> 35 36 # 37 # Client-side 38 <client> 39 <server> 40 http 41 </server> 42 43 # this test needs to be a debug build in order to fake it being a TTY output 44 <features> 45 debug 46 </features> 47 <setenv> 48 CURL_ISATTY=yes 49 </setenv> 50 <name> 51 Refuse binary output to terminal 52 </name> 53 <command> 54 http://%HOSTIP:%HTTPPORT/1425 55 </command> 56 </client> 57 58 # 59 # Verify data after the test has been "shot" 60 <verify> 61 <strip> 62 ^User-Agent:.* 63 </strip> 64 <protocol> 65 GET /1425 HTTP/1.1 66 Host: %HOSTIP:%HTTPPORT 67 Accept: */* 68 69 </protocol> 70 <stdout> 71 HTTP/1.1 200 OK 72 Date: Thu, 09 Nov 2010 14:49:00 GMT 73 Server: test-server/fake 74 Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT 75 ETag: 21025-dc7-39462498 76 Accept-Ranges: bytes 77 Content-Length: 5 78 Connection: close 79 Content-Type: text/html 80 Funny-head: yesyes 81 82 </stdout> 83 # 23 == CURLE_WRITE_ERROR, curl wouldn't accept the binary output 84 <errorcode> 85 23 86 </errorcode> 87 </verify> 88 </testcase> 89