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