This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "varnishscoreboard parallel ESI" | |
barrier b1 cond 3 | |
barrier b2 cond 3 | |
server s1 { | |
rxreq | |
txresp -body { | |
<esi:include src="/c1"/> | |
<esi:include src="/c2"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "varnishncsa logging a client error" | |
server s1 { | |
rxreq | |
txresp -bodylen 10000000 | |
} -start | |
varnish v1 -vcl+backend { | |
} -start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Goto and fallbacks" | |
server s1 { | |
rxreq | |
txresp | |
expect req.url == "/probe" | |
accept | |
rxreq | |
txresp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# S3 v4 request signing (v1.6) | |
# | |
import crypto; | |
import goto; | |
import kvstore; | |
import std; | |
import urlplus; | |
import utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# AWS Secrets Manager v1.0 | |
# | |
import crypto; | |
import http; | |
import json; | |
import kvstore; | |
import utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Use xbody to generate an Etag" | |
server s1 { | |
rxreq | |
txresp -body "This is a test" | |
} -start | |
varnish v1 -vcl+backend { | |
import crypto; | |
import xbody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# JWT - Remote JWK API | |
# | |
vcl 4.1; | |
import edgestash; | |
import goto; | |
import http; | |
import json; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "VTC with v1 routing to itself" | |
# Start v1 with no VCL so we can get a addr and port | |
server s1 {} -start | |
varnish v1 -vcl+backend {} -start | |
varnish v1 -vcl+backend { | |
backend self | |
{ | |
.host = "${v1_addr}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Test HTTP Post timeout" | |
server s1 -repeat 3 { | |
rxreq | |
txresp | |
expect req.body == "postdata is here" | |
} -start | |
varnish v1 -arg "-p timeout_idle=3.0" -vcl+backend { | |
sub vcl_recv { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urlplus; | |
import xbody; | |
sub vcl_backend_response { | |
# Insert the JSONP callback | |
if (urlplus.query_get("callback") && beresp.http.Content-Type ~ "json") { | |
xbody.regsub("^", urlplus.query_get("callback") + "("); | |
xbody.regsub("$", ");"); | |
set beresp.http.Content-Type = regsub(beresp.http.Content-Type, "json", "javascript"); | |
} |