Skip to content

Commit 143f15a

Browse files
committed
Merge pull request #244 from Nyholm/debug_code
Removed test code
2 parents 8019bad + abd1f48 commit 143f15a

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

doc/varnish-configuration.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ User Context
202202

203203
Feature: :doc:`user context hashing <user-context>`
204204

205-
Subroutines are provided in ``resources/config/varnish-[version]/fos_user_context.vcl``.
205+
The ``fos_user_context.vcl`` needs the ``user_context_hash_url`` subroutine that sets a URL to the request lookup URL. The default URL is ``/_fos_user_context_hash`` and you can simply include ``resources/config/varnish-[version]/fos_user_context_url.vcl`` in your configuration to provide this. If you need a different URL, include a custom file implementing the ``user_context_hash_url`` subroutine.
206+
207+
206208
To enable support add the following to ``your_varnish.vcl``:
207209

208210

@@ -211,6 +213,7 @@ To enable support add the following to ``your_varnish.vcl``:
211213
.. code-block:: varnish4
212214
213215
include "path-to-config/varnish-4/fos_user_context.vcl";
216+
include "path-to-config/varnish-4/fos_user_context_url.vcl";
214217
215218
sub vcl_recv {
216219
call fos_user_context_recv;
@@ -227,6 +230,7 @@ To enable support add the following to ``your_varnish.vcl``:
227230
.. code-block:: varnish3
228231
229232
include "path-to-config/varnish-3/fos_user_context.vcl";
233+
include "path-to-config/varnish-4/fos_user_context_url.vcl";
230234
231235
sub vcl_recv {
232236
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)