mirror of https://github.com/scrapy/scrapy.git
Fix method name: this always returns unicode keys and values
This commit is contained in:
parent
49313a6988
commit
617631f264
|
|
@ -82,7 +82,7 @@ class S3DownloadHandler(object):
|
|||
awsrequest = botocore.awsrequest.AWSRequest(
|
||||
method=request.method,
|
||||
url='%s://s3.amazonaws.com/%s%s' % (scheme, bucket, path),
|
||||
headers=request.headers.to_native_string_dict(),
|
||||
headers=request.headers.to_unicode_dict(),
|
||||
data=request.body)
|
||||
self._signer.add_auth(awsrequest)
|
||||
request = request.replace(
|
||||
|
|
|
|||
|
|
@ -79,7 +79,10 @@ class Headers(CaselessDict):
|
|||
def to_string(self):
|
||||
return headers_dict_to_raw(self)
|
||||
|
||||
def to_native_string_dict(self):
|
||||
def to_unicode_dict(self):
|
||||
""" Return headers as a CaselessDict with unicode keys
|
||||
and unicode values. Multiple values are joined with ','.
|
||||
"""
|
||||
return CaselessDict(
|
||||
(to_unicode(key, encoding=self.encoding),
|
||||
to_unicode(b','.join(value), encoding=self.encoding))
|
||||
|
|
|
|||
Loading…
Reference in New Issue