Skip to content

Commit ef497f0

Browse files
committed
Refactored the test code from the vcl
1 parent 78475d2 commit ef497f0

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

doc/varnish-configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ To enable support add the following to ``your_varnish.vcl``:
211211
.. code-block:: varnish4
212212
213213
include "path-to-config/varnish-4/fos_user_context.vcl";
214+
include "path-to-config/varnish-4/fos_user_context_url.vcl";
214215
215216
sub vcl_recv {
216217
call fos_user_context_recv;
@@ -227,6 +228,7 @@ To enable support add the following to ``your_varnish.vcl``:
227228
.. code-block:: varnish3
228229
229230
include "path-to-config/varnish-3/fos_user_context.vcl";
231+
include "path-to-config/varnish-4/fos_user_context_url.vcl";
230232
231233
sub vcl_recv {
232234
call fos_user_context_recv;

resources/config/varnish-3/fos_user_context.vcl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ sub fos_user_context_recv {
3333

3434
# Backup original URL
3535
set req.http.X-Fos-Original-Url = req.url;
36-
set req.url = "/_fos_user_context_hash";
37-
38-
# For functional tests
36+
3937
call user_context_hash_url;
4038

4139
# Force the lookup, the backend must tell not to cache or vary on all
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* This file is part of the FOSHttpCache package.
3+
*
4+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*/
9+
10+
sub user_context_hash_url {
11+
set req.url = "/_fos_user_context_hash";
12+
}

resources/config/varnish-4/fos_user_context.vcl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ sub fos_user_context_recv {
3333

3434
# Backup original URL
3535
set req.http.X-Fos-Original-Url = req.url;
36-
set req.url = "/_fos_user_context_hash";
37-
38-
# For functional tests
36+
3937
call user_context_hash_url;
4038

4139
# Force the lookup, the backend must tell not to cache or vary on all
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* This file is part of the FOSHttpCache package.
3+
*
4+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*/
9+
10+
sub user_context_hash_url {
11+
set req.url = "/_fos_user_context_hash";
12+
}

0 commit comments

Comments
 (0)