File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ sub fos_ban_recv {
2121 // the left side is the response header, the right side the invalidation header
2222 + " && obj.http.X-Cache-Tags ~ " + req.http.X-Cache-Tags
2323 );
24+ } elseif (req.http.Cookie ) {
25+ ban("obj.http.X-Host ~ " + req.http.X-Host
26+ + " && obj.http.X-Url ~ " + req.http.X-Url
27+ + " && obj.http.content-type ~ " + req.http.X-Content-Type
28+ + " && obj.http.Cookie ~ " + req.http.Cookie
29+ );
2430 } else {
2531 ban("obj.http.X-Host ~ " + req.http.X-Host
2632 + " && obj.http.X-Url ~ " + req.http.X-Url
@@ -37,6 +43,9 @@ sub fos_ban_backend_response {
3743 # Set ban-lurker friendly custom headers
3844 set beresp.http.X-Url = bereq.url ;
3945 set beresp.http.X-Host = bereq.http.host ;
46+ if (bereq.http.accept ~ "application/vnd.fos.user-context-hash" ) {
47+ set beresp.http.Cookie = ";" + bereq.http.Cookie ;
48+ }
4049}
4150
4251sub fos_ban_deliver {
@@ -46,6 +55,7 @@ sub fos_ban_deliver {
4655 # Remove ban-lurker friendly custom headers when delivering to client
4756 unset resp.http.X-Url ;
4857 unset resp.http.X-Host ;
58+ unset resp.http.Cookie ;
4959
5060 # Unset the tagged cache headers
5161 unset resp.http.X-Cache-Tags ;
You can’t perform that action at this time.
0 commit comments