Brion VIBBER has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/171502

Change subject: Expose Content-Range response header for CORS requests on 
upload.
......................................................................

Expose Content-Range response header for CORS requests on upload.

When a client submits an HTTP request with 'Range' header, the actual
range returned, including the total file size, comes back in the
'Content-Range' response header.

Naturally, this doesn't get automatically exposed in cross-origin requests
and must be explicitly listed in the OPTIONS response. Yay CORS!

Exposing this will let ogv.js eliminate an extra HEAD request to get
the total file size, and allows validation of the ranges to check for
a Safari caching bug <https://bugs.webkit.org/show_bug.cgi?id=82672>
without adding a cachebuster query string on every request.

Change-Id: I35d51c66814fd23972c8044208b1545b8e20f464
---
M templates/varnish/upload-frontend.inc.vcl.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/02/171502/1

diff --git a/templates/varnish/upload-frontend.inc.vcl.erb 
b/templates/varnish/upload-frontend.inc.vcl.erb
index 62257d9..bbcf905 100644
--- a/templates/varnish/upload-frontend.inc.vcl.erb
+++ b/templates/varnish/upload-frontend.inc.vcl.erb
@@ -117,5 +117,5 @@
        }
 
        set resp.http.Access-Control-Allow-Origin = "*";
-       set resp.http.Access-Control-Expose-Headers = "Age, Date, 
Content-Length, X-Content-Duration, X-Cache, X-Varnish";
+       set resp.http.Access-Control-Expose-Headers = "Age, Date, 
Content-Length, Content-Range, X-Content-Duration, X-Cache, X-Varnish";
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/171502
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35d51c66814fd23972c8044208b1545b8e20f464
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to