~david-goetz/swift/wal_again

« back to all changes in this revision

Viewing changes to swift/proxy/server.py

  • Committer: Tarmac
  • Author(s): Scott Simpson
  • Date: 2011-04-21 20:22:48 UTC
  • mfrom: (283.2.3 lp750752)
  • Revision ID: tarmac-20110421202248-ve87htatdz8na8j4
added the Accept-Ranges header to GET and HEAD requests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
645
645
                        raise
646
646
                res.app_iter = file_iter()
647
647
                update_headers(res, source.getheaders())
 
648
                update_headers(res, {'accept-ranges': 'bytes'})
648
649
                res.status = source.status
649
650
                res.content_length = source.getheader('Content-Length')
650
651
                if source.getheader('Content-Type'):
654
655
            elif 200 <= source.status <= 399:
655
656
                res = status_map[source.status](request=req)
656
657
                update_headers(res, source.getheaders())
 
658
                update_headers(res, {'accept-ranges': 'bytes'})
657
659
                if req.method == 'HEAD':
658
660
                    res.content_length = source.getheader('Content-Length')
659
661
                    if source.getheader('Content-Type'):
828
830
                                                  resp)
829
831
                resp.content_length = content_length
830
832
                resp.last_modified = last_modified
 
833
            resp.headers['accept-ranges'] = 'bytes'
831
834
 
832
835
        return resp
833
836