Skip to content

Instantly share code, notes, and snippets.

@xquery
Created April 9, 2020 11:55
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/3e3eed3c4e9e65cd9f6b3a3fa2dd8082 to your computer and use it in GitHub Desktop.
Save xquery/3e3eed3c4e9e65cd9f6b3a3fa2dd8082 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
Content-Type: text/html
Funny-head: yesyes
Alt-Svc: h2=":9014", ma=315360000; persist=0
test1
</data>
</reply>
#
# Client-side
<client>
<features>
alt-svc
debug
</features>
<server>
http
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">
--alt-svc "log/altsvc-358" -o "log/result358_1.log" "http://localhost:%HTTPPORT/358"
</command>
<file name="log/altsvc-358">
# 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 %HTTPPORT h2 localhost %HTT2PPORT "20290222 22:19:28" 0 0
</file>
<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 %HTTPPORT 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