Skip to content

Instantly share code, notes, and snippets.

@xquery
Last active April 7, 2020 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xquery/9e454202a3dfcc554f89bf802294253a to your computer and use it in GitHub Desktop.
Save xquery/9e454202a3dfcc554f89bf802294253a to your computer and use it in GitHub Desktop.
<testcase>
<info>
<keywords>
HTTP
Alt-Svc
</keywords>
</info>
#
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes
alt-svc: h2=":9015"; ma=86400
test1
</data>
<data1 nocheck="yes">
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: nono
alt-svc: h2=":9015"; ma=86400
test2
</data1>
</reply>
#
# Client-side
<client>
<features>
debug
alt-svc
SSL
</features>
<server>
https Server-localhost-sv.pem
http/2
</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"
</setenv>
<command option="no-output">
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --alt-svc "log/altsvc-358" -o "log/result358_1.log" "https://localhost:%HTTPSPORT/358" -o "log/result358_2.log" "https://localhost:%HTTPSPORT/3580001"
</command>
<precheck>
perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck>
</client>
#
# Verify data after the test has been "shot"
<verify>
<stripfile>
# strip out the (dynamic) expire date from the file so that the rest
# matches
s/\"([^\"]*)\"/TIMESTAMP/
</stripfile>
<file name="log/altsvc-358" mode="text">
# Your alt-svc cache. https://curl.haxx.se/docs/alt-svc.html
# This file was generated by libcurl! Edit at your own risk.
h1 localhost %HTTPSPORT h2 localhost %HTTP2PORT TIMESTAMP 0 0
</file>
</verify>
</testcase>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment