Index: trunk/extensions/SwiftMedia/wmf/rewrite.py |
— | — | @@ -175,13 +175,10 @@ |
176 | 176 | |
177 | 177 | |
178 | 178 | resp = webob.Response(app_iter=upcopy, content_type=c_t) |
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 |
| 179 | + # add in the headers if we've got them |
| 180 | + for header in ['Content-Length', 'Last-Modified', 'Accept-Ranges']: |
| 181 | + if(uinfo.getheader(header)): |
| 182 | + resp.headers.add(header, uinfo.getheader(header)) |
186 | 183 | return resp |
187 | 184 | |
188 | 185 | def __call__(self, env, start_response): |