2019-03-03 18:17:52 +08:00
|
|
|
<testcase>
|
|
|
|
<info>
|
|
|
|
<keywords>
|
|
|
|
HTTP
|
|
|
|
Alt-Svc
|
|
|
|
</keywords>
|
|
|
|
</info>
|
|
|
|
|
|
|
|
#
|
|
|
|
# Server-side
|
|
|
|
<reply>
|
|
|
|
<data>
|
|
|
|
HTTP/1.1 200 OK
|
2020-02-28 22:00:03 +08:00
|
|
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
2019-03-03 18:17:52 +08:00
|
|
|
Content-Length: 6
|
|
|
|
Connection: close
|
|
|
|
Content-Type: text/html
|
|
|
|
Funny-head: yesyes
|
2019-08-02 19:46:49 +08:00
|
|
|
Alt-Svc: h1="nowhere.foo:81", un-kno22!wn=":82"
|
2019-03-03 18:17:52 +08:00
|
|
|
|
|
|
|
-foo-
|
|
|
|
</data>
|
|
|
|
</reply>
|
|
|
|
|
|
|
|
#
|
|
|
|
# Client-side
|
|
|
|
<client>
|
|
|
|
<features>
|
|
|
|
debug
|
|
|
|
alt-svc
|
|
|
|
</features>
|
|
|
|
<server>
|
|
|
|
http
|
|
|
|
</server>
|
|
|
|
<name>
|
|
|
|
parse incoming Alt-Svc and save to file
|
|
|
|
</name>
|
|
|
|
<setenv>
|
|
|
|
# make debug-curl accept Alt-Svc over plain HTTP
|
|
|
|
CURL_ALTSVC_HTTP="yeah"
|
2019-03-24 22:19:50 +08:00
|
|
|
</setenv>
|
2019-03-03 18:17:52 +08:00
|
|
|
<command>
|
2021-03-13 00:38:26 +08:00
|
|
|
http://%HOSTIP:%HTTPPORT/%TESTNUMBER --alt-svc "log/altsvc-%TESTNUMBER"
|
2019-03-03 18:17:52 +08:00
|
|
|
</command>
|
|
|
|
</client>
|
|
|
|
|
|
|
|
#
|
|
|
|
# Verify data after the test has been "shot"
|
|
|
|
<verify>
|
|
|
|
<protocol>
|
2021-03-13 00:38:26 +08:00
|
|
|
GET /%TESTNUMBER HTTP/1.1
|
2019-03-03 18:17:52 +08:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
2020-10-02 19:45:24 +08:00
|
|
|
User-Agent: curl/%VERSION
|
2019-03-03 18:17:52 +08:00
|
|
|
Accept: */*
|
|
|
|
|
|
|
|
</protocol>
|
|
|
|
<stripfile>
|
|
|
|
# strip out the (dynamic) expire date from the file so that the rest
|
|
|
|
# matches
|
|
|
|
s/\"([^\"]*)\"/TIMESTAMP/
|
|
|
|
</stripfile>
|
2021-03-13 00:38:26 +08:00
|
|
|
<file name="log/altsvc-%TESTNUMBER" mode="text">
|
2020-11-04 21:02:01 +08:00
|
|
|
# Your alt-svc cache. https://curl.se/docs/alt-svc.html
|
2019-03-03 18:17:52 +08:00
|
|
|
# This file was generated by libcurl! Edit at your own risk.
|
|
|
|
h1 %HOSTIP %HTTPPORT h1 nowhere.foo 81 TIMESTAMP 0 0
|
|
|
|
</file>
|
|
|
|
</verify>
|
|
|
|
</testcase>
|