Commit 23dd12711fcba5f3898cd93d8c5e1aa8daaa7509

Authored by Antonio Terceiro
1 parent ad272fe1

[varnish] do not return() from our custom VCL

This lets the default VCL logic do its job
etc/noosfero/varnish-noosfero.vcl
@@ -3,13 +3,11 @@ sub vcl_recv { @@ -3,13 +3,11 @@ sub vcl_recv {
3 if (req.http.Cookie) { 3 if (req.http.Cookie) {
4 # We only care about the "_noosfero_session.*" cookie, used for 4 # We only care about the "_noosfero_session.*" cookie, used for
5 # authentication. 5 # authentication.
6 - if (req.http.Cookie ~ "_noosfero_session.*" ) {  
7 - return (pass); 6 + if (req.http.Cookie !~ "_noosfero_session.*" ) {
  7 + # strip all cookies
  8 + unset req.http.Cookie;
8 } 9 }
9 - # Else strip all cookies  
10 - unset req.http.Cookie;  
11 } 10 }
12 - }  
13 } 11 }
14 12
15 sub vcl_error { 13 sub vcl_error {
test/integration/varnish_conf_test.rb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +require 'test/unit'
  2 +
  3 +class VarnishConfTest < Test::Unit::TestCase
  4 +
  5 + def test_not_use_return_in_varnish_noosfero
  6 + assert !system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl')
  7 + end
  8 +
  9 +end