Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 732f5dd

Browse files
committed
Include the fix for authorizing HTTP requests in the older datalab module
1 parent 50b541e commit 732f5dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

datalab/utils/_http.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from past.builtins import basestring
2020
from builtins import object
2121

22+
import copy
2223
import datetime
2324
import json
2425
import urllib.request, urllib.parse, urllib.error
@@ -119,9 +120,12 @@ def request(url, args=None, data=None, headers=None, method=None,
119120
if method is None:
120121
method = 'GET'
121122

122-
# Authorize with credentials if given.
123123
http = Http.http
124+
125+
# Authorize with credentials if given.
124126
if credentials is not None:
127+
# Make a copy of the shared http instance before we modify it.
128+
http = copy.copy(http)
125129
http = credentials.authorize(http)
126130
if stats is not None:
127131
stats['duration'] = datetime.datetime.utcnow()

0 commit comments

Comments
 (0)