Revision 1870855f

b/kamaki/clients/__init__.py
253 253
                    r_headers = r.getheaders()
254 254
                    enc_headers = self._get_headers_to_decode(r_headers)
255 255
                    for k, v in r_headers:
256
                        if k.lower in ('x-auth-token', ) and (
257
                                not self.LOG_TOKEN):
258
                            self._token, v = v, '...'
259
                        elif k.lower() in enc_headers:
260
                            v = unquote(v).decode('utf-8')
261
                        self._headers[k] = v
256
                        self._headers[k] = unquote(v).decode('utf-8') if (
257
                            k.lower()) in enc_headers else v
262 258
                        recvlog.info('  %s: %s%s' % (k, v, plog))
263 259
                    self._content = r.read()
264 260
                    recvlog.info('data size: %s%s' % (
......
344 340
    """Thread-run method(*args, **kwargs)"""
345 341
    def __init__(self, method, *args, **kwargs):
346 342
        super(self.__class__, self).__init__()
347
        self.method = method
348
        self.args = args
349
        self.kwargs = kwargs
343
        self.method, self.args, self.kwargs = method, args, kwargs
350 344

  
351 345
    @property
352 346
    def exception(self):
......
380 374
        self.token = token
381 375
        self.headers, self.params = dict(), dict()
382 376
        self.poolsize = None
383
        self.headers_to_decode, self.header_prefices = [], []
377
        self.response_headers = []
378
        self.response_header_prefices = []
384 379

  
385 380
    def _init_thread_limit(self, limit=1):
386 381
        assert isinstance(limit, int) and limit > 0, 'Thread limit not a +int'
......
501 496
                req,
502 497
                poolsize=self.poolsize,
503 498
                connection_retry_limit=self.CONNECTION_RETRY_LIMIT)
504
            r.headers_to_decode = self.headers_to_decode
505
            r.header_prefices = self.header_prefices
499
            r.headers_to_decode = self.response_headers
500
            r.header_prefices = self.response_header_prefices
506 501
            r.LOG_TOKEN, r.LOG_DATA, r.LOG_PID = (
507 502
                self.LOG_TOKEN, self.LOG_DATA, self.LOG_PID)
508 503
            r._token = headers['X-Auth-Token']
b/kamaki/clients/pithos/rest_api.py
59 59

  
60 60
        :returns: ConnectionResponse
61 61
        """
62
        self.response_headers = ['Last-Modified', ]
63
        self.response_header_prefices = ['X-Account-', ]
62 64

  
63 65
        self._assert_account()
64 66
        path = path4url(self.account)
......
110 112
        :returns: ConnectionResponse
111 113
        """
112 114
        self._assert_account()
115
        self.response_headers = ['Last-Modified', ]
116
        self.response_header_prefices = ['X-Account-', ]
113 117

  
114 118
        self.set_param('limit', limit, iff=limit)
115 119
        self.set_param('marker', marker, iff=marker)
......
155 159

  
156 160
        :returns: ConnectionResponse
157 161
        """
158

  
159 162
        self._assert_account()
160 163

  
161 164
        self.set_param('update', '', iff=update)
......
200 203

  
201 204
        :returns: ConnectionResponse
202 205
        """
203

  
204 206
        self._assert_container()
207
        self.response_headers = ['Last-Modified', ]
208
        self.response_header_prefices = ['X-Container-', ]
205 209

  
206 210
        self.set_param('until', until, iff=until)
207 211

  
......
268 272
        """
269 273

  
270 274
        self._assert_container()
275
        self.response_headers = ['Last-Modified', ]
276
        self.response_header_prefices = ['X-Container-', ]
271 277

  
272 278
        self.set_param('limit', limit, iff=limit)
273 279
        self.set_param('marker', marker, iff=marker)
......
423 429

  
424 430
        :returns: ConnectionResponse
425 431
        """
426

  
427 432
        self._assert_container()
433
        self.response_headers = [
434
            'ETag',
435
            'Content-Length',
436
            'Content-Type',
437
            'Last-Modified',
438
            'Content-Encoding',
439
            'Content-Disposition',
440
        ]
441
        self.response_header_prefices = ['X-Object-', ]
428 442

  
429 443
        self.set_param('version', version, iff=version)
430 444

  
......
479 493

  
480 494
        :returns: ConnectionResponse
481 495
        """
482

  
483 496
        self._assert_container()
497
        self.response_headers = [
498
            'ETag',
499
            'Content-Length',
500
            'Content-Type',
501
            'Last-Modified',
502
            'Content-Encoding',
503
            'Content-Disposition',
504
            'Content-Range',
505
        ]
506
        self.response_header_prefices = ['X-Object-', ]
484 507

  
485 508
        self.set_param('format', format, iff=format)
486 509
        self.set_param('hashmap', hashmap, iff=hashmap)
......
574 597

  
575 598
        :returns: ConnectionResponse
576 599
        """
577

  
578 600
        self._assert_container()
601
        self.response_headers = ['ETag', 'X-Object-Version']
579 602

  
580 603
        self.set_param('format', format, iff=format)
581 604
        self.set_param('hashmap', hashmap, iff=hashmap)
......
671 694

  
672 695
        :returns: ConnectionResponse
673 696
        """
674

  
675 697
        self._assert_container()
698
        self.response_headers = [
699
            'If-Match',
700
            'If-None-Match',
701
            'Destination',
702
            'Destination-Account',
703
            'Content-Type',
704
            'Content-Encoding',
705
            'Content-Disposition',
706
            'X-Source-Version',
707
        ]
708
        self.response_header_prefices = ['X-Object-', ]
676 709

  
677 710
        self.set_param('format', format, iff=format)
678 711
        self.set_param('ignore_content_type', iff=ignore_content_type)
......
759 792

  
760 793
        :returns: ConnectionResponse
761 794
        """
762

  
763 795
        self._assert_container()
796
        self.response_headers = [
797
            'If-Match',
798
            'If-None-Match',
799
            'Destination',
800
            'Destination-Account',
801
            'Content-Type',
802
            'Content-Encoding',
803
            'Content-Disposition',
804
            'X-Source-Version',
805
        ]
806
        self.response_header_prefices = ['X-Object-', ]
764 807

  
765 808
        self.set_param('format', format, iff=format)
766 809
        self.set_param('ignore_content_type', iff=ignore_content_type)
......
858 901

  
859 902
        :returns: ConnectionResponse
860 903
        """
861

  
862 904
        self._assert_container()
905
        self.response_headers = ['ETag', 'X-Object-Version']
863 906

  
864 907
        self.set_param('format', format, iff=format)
865 908
        self.set_param('update', '', iff=update)

Also available in: Unified diff