use CaseInsensitiveDict
This commit is contained in:
parent
bf34774533
commit
a0d5c793eb
1 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,7 @@ import zlib
|
|||
from io import BytesIO
|
||||
import urllib
|
||||
import requests
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
|
||||
from .utils import json
|
||||
|
@ -65,7 +66,7 @@ def get_headers(url, data=None, headers=None, timeout=cache_timeout):
|
|||
if not url_headers:
|
||||
url_headers = net.get_headers(url, data, headers)
|
||||
store.set(url, data, -1, url_headers)
|
||||
return url_headers
|
||||
return CaseInsensitiveDict(url_headers)
|
||||
|
||||
def get_json(url, data=None, headers=None, timeout=cache_timeout):
|
||||
return json.loads(read_url(url, data, headers, timeout).decode('utf-8'))
|
||||
|
@ -261,6 +262,8 @@ class SQLiteCache(Cache):
|
|||
data = zlib.compress(data)
|
||||
else:
|
||||
compressed = 0
|
||||
if isinstance(data, str):
|
||||
data = data.encode("utf-8")
|
||||
data = sqlite3.Binary(data)
|
||||
|
||||
#fixme: this looks wrong
|
||||
|
|
Loading…
Reference in a new issue