From c17cbe607a8cfacd65a7092c253e180dad5a6b7e Mon Sep 17 00:00:00 2001 From: Thorsten Reiter Date: Tue, 25 Feb 2025 14:37:34 +0100 Subject: [PATCH 1/3] Fixed basic auth snippet --- .../cache/http_cache/fastly.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md b/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md index bfa68e6e94..e7cc614633 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md @@ -462,6 +462,11 @@ if (fastly.ff.visits_this_service == 0 && req.restarts == 0) { error 401 "Restricted"; } } + +# 1st ESI request still has req.http.Authorization set - making the request uncacheable +if (req.is_esi_subreq) { + unset req.http.Authorization; +} ``` To enable basic-auth for one domain only, alter `snippet_basic_auth_recv.vcl`: From 0d9f24023a5142fe9f37efb5abf7755493942b3a Mon Sep 17 00:00:00 2001 From: Thorsten Reiter <34274688+reithor@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:02:09 +0100 Subject: [PATCH 2/3] Update docs/infrastructure_and_maintenance/cache/http_cache/fastly.md Co-authored-by: Vidar Langseid --- docs/infrastructure_and_maintenance/cache/http_cache/fastly.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md b/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md index e7cc614633..a192667e5e 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md @@ -463,7 +463,7 @@ if (fastly.ff.visits_this_service == 0 && req.restarts == 0) { } } -# 1st ESI request still has req.http.Authorization set - making the request uncacheable +# Unsetting req.http.Authorization to avoid reaching "return(pass)" in vcl_recv for first ESI if (req.is_esi_subreq) { unset req.http.Authorization; } From 388f5fae5a0c40a6daf67d29a22e6694a8b5ac79 Mon Sep 17 00:00:00 2001 From: Thorsten Reiter <34274688+reithor@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:23:24 +0100 Subject: [PATCH 3/3] Update docs/infrastructure_and_maintenance/cache/http_cache/fastly.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marek NocoĊ„ --- docs/infrastructure_and_maintenance/cache/http_cache/fastly.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md b/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md index a192667e5e..db558d3235 100644 --- a/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md +++ b/docs/infrastructure_and_maintenance/cache/http_cache/fastly.md @@ -463,7 +463,7 @@ if (fastly.ff.visits_this_service == 0 && req.restarts == 0) { } } -# Unsetting req.http.Authorization to avoid reaching "return(pass)" in vcl_recv for first ESI +# Unsetting req.http.Authorization to avoid reaching "return(pass)" in vcl_recv for the first ESI request if (req.is_esi_subreq) { unset req.http.Authorization; }