~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/response.py

  • Committer: Martin Pool
  • Date: 2006-11-02 10:20:19 UTC
  • mfrom: (2114 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2119.
  • Revision ID: mbp@sourcefrog.net-20061102102019-9a5a02f485dff6f6
merge bzr.dev and reconcile several changes, also some test fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Michael Ellerman
2
 
#           modified by John Arbash Meinel (Canonical Ltd)
 
1
# Copyright (C) 2006 Canonical Ltd
3
2
#
4
3
# This program is free software; you can redistribute it and/or modify
5
4
# it under the terms of the GNU General Public License as published by
251
250
        try:
252
251
            content_type = headers['Content-Type']
253
252
        except KeyError:
254
 
            raise errors.InvalidHttpContentType(url, '',
255
 
                msg='Missing Content-Type')
 
253
            # When there is no content-type header we treat
 
254
            # the response as being of type 'application/octet-stream' as per
 
255
            # RFC2616 section 7.2.1.
 
256
            # Therefore it is obviously not multipart
 
257
            content_type = 'application/octet-stream'
 
258
            is_multipart = False
 
259
        else:
 
260
            is_multipart = _is_multipart(content_type)
256
261
 
257
 
        if _is_multipart(content_type):
 
262
        if is_multipart:
258
263
            # Full fledged multipart response
259
264
            return HttpMultipartRangeResponse(url, content_type, data)
260
265
        else: