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

Commit

Permalink
fix(static): don't redeclare var
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Apr 25, 2019
1 parent 1bc1e24 commit 3f23556
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/fastly/helix.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,12 @@ sub hlx_type_redirect {

sub hlx_fetch_static {
set req.http.X-Trace = req.http.X-Trace + "; hlx_fetch_static";
declare local var.ext STRING;

if (req.http.X-Request-Type == "Static-ESI" && beresp.status == 200) {
set req.http.X-Trace = req.http.X-Trace + "(esi)";
# Get the ETag response header and use it to construct a stable URL
declare local var.ext STRING;


set var.ext = ".hlx_" + digest.hash_sha1(beresp.http.ETag);
set req.http.X-Trace = req.http.X-Trace + "[url=" + req.http.X-Orig-URL + ", ext=" + var.ext + "]";
Expand All @@ -514,7 +515,6 @@ sub hlx_fetch_static {
if (req.http.X-Orig-URL ~ "^(.*)(.hlx_([0-9a-f]){20,40}$)") {
set req.http.X-Trace = req.http.X-Trace + "(immutable)";

declare local var.ext STRING;
set var.ext = ".hlx_" + digest.hash_sha1(beresp.http.ETag);

if (req.group.2 == var.ext) {
Expand Down

0 comments on commit 3f23556

Please sign in to comment.