From fd5a5db0429b617e0785da8d584132815590fedf Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Tue, 30 Apr 2019 12:21:38 +0000 Subject: [PATCH] fix(static): strip 302 from URL when requesting a redirect --- layouts/fastly/helix.vcl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/layouts/fastly/helix.vcl b/layouts/fastly/helix.vcl index 9d8dd668..9f38e01a 100644 --- a/layouts/fastly/helix.vcl +++ b/layouts/fastly/helix.vcl @@ -433,8 +433,8 @@ sub hlx_type_static_url { call hlx_github_static_root; # TODO: check for URL ending with `/` and look up index file - set var.path = regsub(req.http.X-Orig-URL, ".url$", ""); - set var.entry = regsub(req.http.X-Orig-URL, ".url$", ""); + set var.path = regsub(req.http.X-Orig-URL, ".(url|302)$", ""); + set var.entry = regsub(req.http.X-Orig-URL, ".(url|302)$", ""); set req.http.X-Action-Root = "/api/v1/web/" + table.lookup(secrets, "OPENWHISK_NAMESPACE") + "/default/hlx--static"; set req.http.X-Backend-URL = req.http.X-Action-Root @@ -449,7 +449,6 @@ sub hlx_type_static_url { + "&allow=" urlencode(req.http.X-Allow) + "&deny=" urlencode(req.http.X-Deny) + "&root=" + req.http.X-Github-Static-Root; - } /**