Skip to content

Commit c68501e

Browse files
committed
fixes #280
1 parent 6322daf commit c68501e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

fastcore/net.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
# Cell
3333
url_default_headers = {
34-
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
35-
# "Accept-Encoding": "gzip, deflate, br",
34+
"Accept":
35+
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
3636
"Accept-Language": "en-US,en;q=0.9",
3737
"Cache-Control": "max-age=0",
3838
"Sec-Fetch-Dest": "document",
@@ -139,7 +139,7 @@ def urlclean(url):
139139
# Cell
140140
def urlsave(url, dest=None):
141141
"Retrieve `url` and save based on its name"
142-
res = urlread(urlwrap(url))
142+
res = urlread(urlwrap(url), decode=False)
143143
if dest is None: dest = Path(url).name
144144
name = urlclean(dest)
145145
Path(name).write_bytes(res)

nbs/03b_net.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"source": [
6161
"#export\n",
6262
"url_default_headers = {\n",
63-
" \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\",\n",
64-
"# \"Accept-Encoding\": \"gzip, deflate, br\",\n",
63+
" \"Accept\":\n",
64+
" \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\",\n",
6565
" \"Accept-Language\": \"en-US,en;q=0.9\",\n",
6666
" \"Cache-Control\": \"max-age=0\",\n",
6767
" \"Sec-Fetch-Dest\": \"document\",\n",
@@ -369,7 +369,7 @@
369369
"#export\n",
370370
"def urlsave(url, dest=None):\n",
371371
" \"Retrieve `url` and save based on its name\"\n",
372-
" res = urlread(urlwrap(url))\n",
372+
" res = urlread(urlwrap(url), decode=False)\n",
373373
" if dest is None: dest = Path(url).name\n",
374374
" name = urlclean(dest)\n",
375375
" Path(name).write_bytes(res)\n",

0 commit comments

Comments
 (0)