Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_session(self):
session = ProxmoxHttpSession()
session.verify = self.verify_ssl
session.auth = self.auth
session.cookies = cookiejar_from_dict({"PVEAuthCookie": self.auth.pve_auth_cookie})
session.headers['Connection'] = 'keep-alive'
session.headers["accept"] = self.get_serializer().get_accept_types()
return session
timeout=None, allow_redirects=True, proxies=None, hooks=None, stream=None, verify=None, cert=None,
serializer=None):
#filter out streams
files = files or {}
data = data or {}
for k, v in data.copy().items():
if is_file(v):
files[k] = v
del data[k]
headers = None
if not files and serializer:
headers = {"content-type": 'application/x-www-form-urlencoded'}
return super(ProxmoxHttpSession, self).request(method, url, params, data, headers, cookies, files, auth,
timeout, allow_redirects, proxies, hooks, stream, verify, cert)