~notmyname/swift/stale_headers

« back to all changes in this revision

Viewing changes to test/unit/proxy/test_server.py

  • Committer: Tarmac
  • Author(s): John Dickinson
  • Date: 2011-08-23 15:22:26 UTC
  • mfrom: (345.2.2 manifest_headers)
  • Revision ID: tarmac-20110823152226-ivgzux9bowm5bnme
updated the proxy to return all headers stored for manifest objects

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    mkdirs(os.path.join(_testdir, 'sdb1', 'tmp'))
72
72
    _orig_container_listing_limit = proxy_server.CONTAINER_LISTING_LIMIT
73
73
    conf = {'devices': _testdir, 'swift_dir': _testdir,
74
 
            'mount_check': 'false'}
 
74
            'mount_check': 'false', 'allowed_headers':
 
75
            'content-encoding, x-object-manifest, content-disposition, foo'}
75
76
    prolis = listen(('localhost', 0))
76
77
    acc1lis = listen(('localhost', 0))
77
78
    acc2lis = listen(('localhost', 0))
2437
2438
        fd.write('PUT /v1/a/segmented/name HTTP/1.1\r\nHost: '
2438
2439
            'localhost\r\nConnection: close\r\nX-Storage-Token: '
2439
2440
            't\r\nContent-Length: 0\r\nX-Object-Manifest: '
2440
 
            'segmented/name/\r\nContent-Type: text/jibberish\r\n\r\n')
 
2441
            'segmented/name/\r\nContent-Type: text/jibberish\r\n'
 
2442
            'Foo: barbaz\r\n\r\n')
2441
2443
        fd.flush()
2442
2444
        headers = readuntil2crlfs(fd)
2443
2445
        exp = 'HTTP/1.1 201'
2454
2456
        self.assertEquals(headers[:len(exp)], exp)
2455
2457
        self.assert_('X-Object-Manifest: segmented/name/' in headers)
2456
2458
        self.assert_('Content-Type: text/jibberish' in headers)
 
2459
        self.assert_('Foo: barbaz' in headers)
2457
2460
        body = fd.read()
2458
2461
        self.assertEquals(body, '1234 1234 1234 1234 1234 ')
2459
2462
        # Do it again but exceeding the container listing limit