Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
fix(static): strip 302 from URL when requesting a redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Apr 30, 2019
1 parent 403ae1b commit fd5a5db
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions layouts/fastly/helix.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

}

/**
Expand Down

0 comments on commit fd5a5db

Please sign in to comment.