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

Fix a bug where an unbounded number of credentials wrappers got added. #296

Merged
merged 4 commits into from
Mar 10, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion google/datalab/utils/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from past.builtins import basestring
from builtins import object

import copy
import datetime
import json
import urllib.request, urllib.parse, urllib.error
Expand Down Expand Up @@ -119,9 +120,12 @@ def request(url, args=None, data=None, headers=None, method=None,
if method is None:
method = 'GET'

# Authorize with credentials if given
http = Http.http

# Authorize with credentials if given
if credentials is not None:
# Make a copy of the shared http instance before we modify it.
http = copy.copy(http)
http = credentials.authorize(http)
if stats is not None:
stats['duration'] = datetime.datetime.utcnow()
Expand Down