xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | Alt-Svc |
| 6 | </keywords> |
| 7 | </info> |
| 8 | |
| 9 | # |
| 10 | # Server-side |
| 11 | <reply> |
| 12 | <data> |
| 13 | HTTP/1.1 200 OK |
| 14 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 15 | Content-Length: 6 |
| 16 | Connection: close |
| 17 | Content-Type: text/html |
| 18 | Funny-head: yesyes |
| 19 | Alt-Svc: h1="nowhere.foo:-1" |
| 20 | Alt-Svc: h1="nowhere.foo:81", un-kno22!wn=":82" |
| 21 | Alt-Svc: h1="nowhere.foo:70000" |
| 22 | |
| 23 | -foo- |
| 24 | </data> |
| 25 | </reply> |
| 26 | |
| 27 | # |
| 28 | # Client-side |
| 29 | <client> |
| 30 | <features> |
| 31 | debug |
| 32 | alt-svc |
| 33 | </features> |
| 34 | <server> |
| 35 | http |
| 36 | </server> |
| 37 | <name> |
| 38 | parse incoming Alt-Svc and save to file |
| 39 | </name> |
| 40 | <setenv> |
| 41 | # make debug-curl accept Alt-Svc over plain HTTP |
| 42 | CURL_ALTSVC_HTTP="yeah" |
| 43 | </setenv> |
| 44 | <command> |
| 45 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER --alt-svc "log/altsvc-%TESTNUMBER" |
| 46 | </command> |
| 47 | </client> |
| 48 | |
| 49 | # |
| 50 | # Verify data after the test has been "shot" |
| 51 | <verify> |
| 52 | <protocol> |
| 53 | GET /%TESTNUMBER HTTP/1.1
|
| 54 | Host: %HOSTIP:%HTTPPORT
|
| 55 | User-Agent: curl/%VERSION
|
| 56 | Accept: */*
|
| 57 |
|
| 58 | </protocol> |
| 59 | <stripfile> |
| 60 | # strip out the (dynamic) expire date from the file so that the rest |
| 61 | # matches |
| 62 | s/\"([^\"]*)\"/TIMESTAMP/ |
| 63 | </stripfile> |
| 64 | <file name="log/altsvc-%TESTNUMBER" mode="text"> |
| 65 | # Your alt-svc cache. https://curl.se/docs/alt-svc.html |
| 66 | # This file was generated by libcurl! Edit at your own risk. |
| 67 | h1 %HOSTIP %HTTPPORT h1 nowhere.foo 81 TIMESTAMP 0 0 |
| 68 | </file> |
| 69 | </verify> |
| 70 | </testcase> |