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

Commit

Permalink
fix(static): use req for tracing instead of resp
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Apr 25, 2019
1 parent 3d24575 commit 806d48d
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,12 +499,12 @@ sub hlx_fetch_static {
set req.http.X-Trace = req.http.X-Trace + "; hlx_fetch_static";

if (req.http.X-Request-Type == "Static-ESI" && beresp.status == 200) {
set resp.http.X-Static-Trace = resp.http.X-Static-Trace + "(esi)";
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 resp.http.X-Static-Trace = resp.http.X-Static-Trace + "[url=" + req.http.X-Orig-URL + ", ext=" + var.ext + "]";
set req.http.X-Trace = req.http.X-Trace + "[url=" + req.http.X-Orig-URL + ", ext=" + var.ext + "]";
set req.http.X-Location = regsub(req.http.X-Orig-URL, ".esi$", var.ext);
error 303 "ESI";
}
Expand Down

0 comments on commit 806d48d

Please sign in to comment.