Skip to content

Commit

Permalink
Update maptomethod.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ThHanke authored Sep 25, 2024
1 parent e128c31 commit 218a4b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions maptomethod.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import inspect
import logging
import ssl
import sys
from collections import OrderedDict
from re import search as re_search
Expand All @@ -22,8 +21,9 @@
from yaml.representer import SafeRepresenter
from yaml.resolver import BaseResolver

# disable ssl verification
ssl._create_default_https_context = ssl._create_unverified_context
SSL_VERIFY = os.getenv("SSL_VERIFY", "True").lower() in ("true", "1", "t")
if not SSL_VERIFY:
requests.packages.urllib3.disable_warnings()


def dict_representer(dumper, data):
Expand Down Expand Up @@ -104,6 +104,7 @@ def open_file(uri: AnyUrl,authorization= None) -> Tuple["filedata": str, "filena
if uri_parsed.scheme in ["https", "http"]:
# r = urlopen(uri)
s= requests.Session()
s.verify = SSL_VERIFY
s.headers.update({"Authorization": authorization})
r = s.get(uri, allow_redirects=True, stream=True)

Expand Down

0 comments on commit 218a4b0

Please sign in to comment.