Mark Bergsma has submitted this change and it was merged.
Change subject: Derive the corresponding original URL and store it with the
thumb
......................................................................
Derive the corresponding original URL and store it with the thumb
Change-Id: I5c93e62aea4c1331e257bd0a9844ac8ed8f8a1ad
---
M templates/varnish/upload-backend.inc.vcl.erb
M templates/varnish/upload-frontend.inc.vcl.erb
2 files changed, 7 insertions(+), 0 deletions(-)
Approvals:
Mark Bergsma: Looks good to me, approved
jenkins-bot: Verified
diff --git a/templates/varnish/upload-backend.inc.vcl.erb
b/templates/varnish/upload-backend.inc.vcl.erb
index 3ffd411..56d30da 100644
--- a/templates/varnish/upload-backend.inc.vcl.erb
+++ b/templates/varnish/upload-backend.inc.vcl.erb
@@ -126,6 +126,11 @@
set beresp.http.X-Content-Range = beresp.http.Content-Range;
}
+ # Derive the corresponding original URL and store it with the object
+ if (!beresp.http.X-MediaWiki-Original && req.url ~
"^/+[^/]+/[^/]+/thumb/[^/]+/[^/]+/[^/]+/[0-9]+px-") {
+ set beresp.http.X-MediaWiki-Original = regsub(req.url,
"^(/+[^/]+/[^/]+/)thumb/([^/]+/[^/]+/[^/]+).*$", "\1\2");
+ }
+
return (deliver);
}
diff --git a/templates/varnish/upload-frontend.inc.vcl.erb
b/templates/varnish/upload-frontend.inc.vcl.erb
index 5ac95ab..574f033 100644
--- a/templates/varnish/upload-frontend.inc.vcl.erb
+++ b/templates/varnish/upload-frontend.inc.vcl.erb
@@ -76,6 +76,8 @@
}
sub vcl_deliver {
+ unset resp.http.X-MediaWiki-Original;
+
if (resp.http.X-Content-Range) {
set resp.http.Content-Range = resp.http.X-Content-Range;
remove resp.http.X-Content-Range;
--
To view, visit https://gerrit.wikimedia.org/r/101207
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5c93e62aea4c1331e257bd0a9844ac8ed8f8a1ad
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma <[email protected]>
Gerrit-Reviewer: Mark Bergsma <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits