~gholt/swift/timeout_baseexception

« back to all changes in this revision

Viewing changes to swift/common/middleware/swift3.py

  • Committer: Tarmac
  • Author(s): FUJITA Tomonori
  • Date: 2011-03-15 15:37:24 UTC
  • mfrom: (224.5.2 swift-copy-2)
  • Revision ID: tarmac-20110315153724-vi8zsfh4vl8ab7f2
s3api: fix PUT Object Copy

Show diffs side-by-side

added added

removed removed

Lines of Context:
329
329
            elif key == 'HTTP_CONTENT_MD5':
330
330
                env['HTTP_ETAG'] = value.decode('base64').encode('hex')
331
331
            elif key == 'HTTP_X_AMZ_COPY_SOURCE':
332
 
                env['HTTP_X_OBJECT_COPY'] = value
 
332
                env['HTTP_X_COPY_FROM'] = value
333
333
 
334
334
        body_iter = self.app(env, self.do_start_response)
335
335
        status = int(self.response_args[0].split()[0])
343
343
            else:
344
344
                return get_err_response('InvalidURI')
345
345
 
 
346
        if 'HTTP_X_COPY_FROM' in env:
 
347
            body = '<CopyObjectResult>' \
 
348
                   '<ETag>"%s"</ETag>' \
 
349
                   '</CopyObjectResult>' % headers['etag']
 
350
            return Response(status=200, body=body)
 
351
 
346
352
        return Response(status=200, etag=headers['etag'])
347
353
 
348
354
    def DELETE(self, env, start_response):