xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | Alt-Svc |
| 7 | HTTP/2 |
| 8 | </keywords> |
| 9 | </info> |
| 10 | |
| 11 | # |
| 12 | # Server-side |
| 13 | <reply> |
| 14 | <data nocheck="yes"> |
| 15 | HTTP/1.1 200 OK
|
| 16 | Date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 17 | Content-Length: 6
|
| 18 | Connection: close
|
| 19 | Content-Type: text/html
|
| 20 | Funny-head: yesyes
|
| 21 | Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0
|
| 22 |
|
| 23 | -foo- |
| 24 | </data> |
| 25 | </reply> |
| 26 | |
| 27 | # |
| 28 | # Client-side |
| 29 | <client> |
| 30 | <features> |
| 31 | alt-svc |
| 32 | debug |
| 33 | h2c |
| 34 | </features> |
| 35 | <server> |
| 36 | http |
| 37 | http/2 |
| 38 | </server> |
| 39 | <name> |
| 40 | HTTPS GET translated by alt-svc lookup to HTTP/2 GET |
| 41 | </name> |
| 42 | <setenv> |
| 43 | # make debug-curl accept Alt-Svc over plain HTTP |
| 44 | CURL_ALTSVC_HTTP="yeah" |
| 45 | </setenv> |
| 46 | <command> |
| 47 | --http2 --alt-svc "log/altsvc-%TESTNUMBER" "http://%HOSTIP:%HTTPPORT/%TESTNUMBER" "http://%HOSTIP:%HTTPPORT/%TESTNUMBER" |
| 48 | </command> |
| 49 | <file name="log/altsvc-%TESTNUMBER"> |
| 50 | h2 %HOSTIP %HTTPPORT h2 %HOSTIP %HTTP2PORT "20290222 22:19:28" 0 0 |
| 51 | </file> |
| 52 | |
| 53 | </client> |
| 54 | |
| 55 | # |
| 56 | # Verify data after the test has been "shot" |
| 57 | <verify> |
| 58 | <stdout> |
| 59 | HTTP/1.1 101 Switching Protocols
|
| 60 | Connection: Upgrade
|
| 61 | Upgrade: h2c
|
| 62 |
|
| 63 | HTTP/2 200
|
| 64 | date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 65 | content-length: 6
|
| 66 | content-type: text/html
|
| 67 | funny-head: yesyes
|
| 68 | alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0
|
| 69 | via: 1.1 nghttpx
|
| 70 |
|
| 71 | -foo- |
| 72 | HTTP/2 200
|
| 73 | date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 74 | content-length: 6
|
| 75 | content-type: text/html
|
| 76 | funny-head: yesyes
|
| 77 | alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0
|
| 78 | via: 1.1 nghttpx
|
| 79 |
|
| 80 | -foo- |
| 81 | </stdout> |
| 82 | <stripfile> |
| 83 | s/^server: nghttpx.*\r?\n// |
| 84 | # strip out the (dynamic) expire date from the file so that the rest |
| 85 | # matches |
| 86 | s/\"2([^\"]*)\"/TIMESTAMP/ |
| 87 | </stripfile> |
| 88 | <file name="log/altsvc-%TESTNUMBER" mode="text"> |
| 89 | # Your alt-svc cache. https://curl.se/docs/alt-svc.html |
| 90 | # This file was generated by libcurl! Edit at your own risk. |
| 91 | h2 %HOSTIP %HTTPPORT h2 %HOSTIP %HTTP2PORT TIMESTAMP 0 0 |
| 92 | </file> |
| 93 | </verify> |
| 94 | </testcase> |