X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ftemplates%2Fsnapshot%2Fsnapshot.debian.org.vcl.erb;h=c01fcb73e1adbd1659034d241a7438abfa391b65;hb=8199281b7f26f447723611cff0f7e3057d1e97a8;hp=8659b637f1c685269f33b56aeb4ce9094fcddca4;hpb=89395035e7032a56e0071ccd4c19475ddd43d361;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/templates/snapshot/snapshot.debian.org.vcl.erb b/modules/roles/templates/snapshot/snapshot.debian.org.vcl.erb index 8659b637f..c01fcb73e 100644 --- a/modules/roles/templates/snapshot/snapshot.debian.org.vcl.erb +++ b/modules/roles/templates/snapshot/snapshot.debian.org.vcl.erb @@ -35,3 +35,14 @@ sub vcl_deliver { set resp.http.connection = "close"; } } + +sub vcl_backend_response { + if (bereq.retries == 0 && + beresp.status == 302 && + beresp.http.location ~ "https?://[^/]*/file/") { + set beresp.http.location = regsub(beresp.http.location,"^https?://",""); + set bereq.http.host = regsub(beresp.http.location,"/.*$",""); + set bereq.url = regsub(beresp.http.location,"[^/]*",""); + return (retry); + } +}