Commit 2881bda3 authored by Jonathan Huot's avatar Jonathan Huot Committed by Dridi Boukelmoune

Fix indentation

parent 7387ecb5
sub samesite {
# See list here:
# https://www.chromium.org/updates/same-site/incompatible-clients
unset req.http.X-UA-SameSiteNone;
set req.http.X-UA-SameSiteNone = "supported";
unset req.http.X-UA-SameSiteNone;
set req.http.X-UA-SameSiteNone = "supported";
# Versions of Chrome from Chrome 51 to Chrome 66 (inclusive on both ends). These Chrome versions will reject a cookie with `SameSite=None`
if (req.http.user-agent ~ "Chrom(e|ium)" &&
......
......@@ -17,7 +17,7 @@ server s1 -repeat 2 {
varnish v1 -vcl+backend {
include "${projectdir}/samesite.vcl";
sub vcl_deliver {
call samesite;
call samesite;
if (resp.http.set-cookie &&
resp.http.set-cookie ~ "ThirdPartyCookie=" &&
......@@ -26,44 +26,44 @@ varnish v1 -vcl+backend {
if (req.http.X-UA-SameSiteNone == "supported") {
set resp.http.Set-Cookie = resp.http.set-cookie + ";SameSite=None";
}
}
}
}
} -start
# test with browser which does not support SameSite=None
client c1 {
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "FirstPartyCookie=foobar"
rxresp
expect resp.http.Set-Cookie == "FirstPartyCookie=foobar"
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar"
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;Path=/;Secure"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;Path=/;Secure"
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;SameSite=lax"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;SameSite=lax"
} -run
# test with browser which support SameSite=None
client c1 {
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "FirstPartyCookie=foobar"
rxresp
expect resp.http.Set-Cookie == "FirstPartyCookie=foobar"
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;SameSite=None"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;SameSite=None"
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;Path=/;Secure;SameSite=None"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;Path=/;Secure;SameSite=None"
txreq -hdr "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.3904.130"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;SameSite=lax"
rxresp
expect resp.http.Set-Cookie == "ThirdPartyCookie=foobar;SameSite=lax"
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment