File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -238,14 +238,11 @@ resource "fastly_service_vcl" "channels" {
238
238
set beresp.grace = 0s;
239
239
set beresp.cacheable = false;
240
240
if (req.backend.is_origin && std.suffixof(bereq.url, "/nixexprs.tar.xz")) {
241
- # rename prepared link header if available
242
- if (beresp.http.x-amz-meta-link) {
243
- set beresp.http.link = beresp.http.x-amz-meta-link;
244
- unset beresp.http.x-amz-meta-link;
245
- # otherwise, use fallback that contains no flake attributes (e.g. rev)
246
- } else {
247
- set beresp.http.link = "<" + beresp.http.location + {">; rel="immutable""};
248
- }
241
+ # pass redirect location into special flake "immutable tarball" header
242
+ set beresp.http.link = "<" + beresp.http.location + {">; rel="immutable""};
243
+ # clear query string from redirect destination as precaution in case
244
+ # legacy consumers can't handle flake attributes like "?rev=" in it
245
+ set beresp.http.location = querystring.remove(beresp.http.location);
249
246
}
250
247
return (pass);
251
248
}
You can’t perform that action at this time.
0 commit comments