Skip to content

Commit

Permalink
Use urllib3 make_headers to generate proxy headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-feld committed Jul 14, 2020
1 parent 1e10d7f commit 1ad4c38
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/newrelic_telemetry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import base64
import json
import logging
import uuid
Expand Down Expand Up @@ -155,10 +154,7 @@ def __init__(self, insert_key, host=None, port=443):
# hopefully be interpreted as an incorrect username/password
# combination rather than causing a security issue where
# information may be leaked (control characters, etc.)
basic_auth = base64.b64encode(proxy.auth.encode("utf-8"))
proxy_headers = {
"Proxy-Authorization": "Basic " + basic_auth.decode("utf-8")
}
proxy_headers = urllib3.make_headers(proxy_basic_auth=proxy.auth)

self._pool = self.POOL_CLS(
host=host,
Expand Down

0 comments on commit 1ad4c38

Please sign in to comment.