v0.39.0
This commit is contained in:
1 parent
5e43752041
commit
15425fb803
34 files changed
+1423
-89
No files matched your search
@@ -0,0 +1,22 @@
|
||||
// Controlled, PUBLIC A/B variants: client sends X-Experiment: A or B.
|
||||
// Origin must also return Vary: X-Experiment, preserve other Vary fields,
|
||||
// and never associate this header with credentials or private data.
|
||||
sub vcl_recv {
|
||||
if (req.method != "GET" && req.method != "HEAD") {
|
||||
return(pass);
|
||||
}
|
||||
if (req.http.Authorization || req.http.Cookie) {
|
||||
return(pass);
|
||||
}
|
||||
if (req.url ~ "^/experiment(/|[?]|$)") {
|
||||
if (req.http.X-Experiment ~ "^(A|B)$") {
|
||||
return(hash);
|
||||
}
|
||||
return(pass);
|
||||
}
|
||||
return(pass);
|
||||
}
|
||||
|
||||
sub vcl_hash {
|
||||
hash_data(req.http.X-Experiment);
|
||||
}
|
||||
Reference in new issue
Block a user