r111781 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111780‎ | r111781 | r111782 >
Date:19:55, 17 February 2012
Author:ben
Status:ok
Tags:
Comment:
add in Accept-Ranges header to be consistent. Also it's ok if we can't get the headers.
Modified paths:
  • /trunk/extensions/SwiftMedia/wmf/rewrite.py (modified) (history)

Diff [purge]

Index: trunk/extensions/SwiftMedia/wmf/rewrite.py
@@ -175,8 +175,13 @@
176176
177177
178178 resp = webob.Response(app_iter=upcopy, content_type=c_t)
179 - resp.headers.add('Content-Length', uinfo.getheader('Content-Length'))
180 - resp.headers.add('Last-Modified', uinfo.getheader('Last-Modified'))
 179+ try:
 180+ resp.headers.add('Content-Length', uinfo.getheader('Content-Length'))
 181+ resp.headers.add('Last-Modified', uinfo.getheader('Last-Modified'))
 182+ resp.headers.add('Accept-Ranges', uinfo.getheader('Accept-Ranges'))
 183+ except:
 184+ # grab the headers if we can, no biggy if we can't.
 185+ pass
181186 return resp
182187
183188 def __call__(self, env, start_response):

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111778Do not write the object to swift for HEAD requests, just return it to the user.ben19:47, 17 February 2012

Status & tagging log