diff --git a/etc/noosfero/varnish-noosfero.vcl b/etc/noosfero/varnish-noosfero.vcl index 4aff0aa..ede7de7 100644 --- a/etc/noosfero/varnish-noosfero.vcl +++ b/etc/noosfero/varnish-noosfero.vcl @@ -3,13 +3,11 @@ sub vcl_recv { if (req.http.Cookie) { # We only care about the "_noosfero_session.*" cookie, used for # authentication. - if (req.http.Cookie ~ "_noosfero_session.*" ) { - return (pass); + if (req.http.Cookie !~ "_noosfero_session.*" ) { + # strip all cookies + unset req.http.Cookie; } - # Else strip all cookies - unset req.http.Cookie; } - } } sub vcl_error { diff --git a/test/integration/varnish_conf_test.rb b/test/integration/varnish_conf_test.rb new file mode 100644 index 0000000..4bbc85a --- /dev/null +++ b/test/integration/varnish_conf_test.rb @@ -0,0 +1,9 @@ +require 'test/unit' + +class VarnishConfTest < Test::Unit::TestCase + + def test_not_use_return_in_varnish_noosfero + assert !system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl') + end + +end -- libgit2 0.21.2