Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow requests connection timeout to be set #204

Merged
merged 1 commit into from
Aug 3, 2022
Merged
Changes from all 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 caldav/davclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def __init__(
username=None,
password=None,
auth=None,
timeout=None,
ssl_verify_cert=True,
ssl_cert=None,
):
Expand All @@ -323,7 +324,7 @@ def __init__(
* url: A fully qualified url: `scheme://user:pass@hostname:port`
* proxy: A string defining a proxy server: `hostname:port`
* username and password should be passed as arguments or in the URL
* auth and ssl_verify_cert is passed to requests.request.
* auth, timeout and ssl_verify_cert are passed to requests.request.
** ssl_verify_cert can be the path of a CA-bundle or False.
"""

Expand Down Expand Up @@ -365,6 +366,7 @@ def __init__(
self.auth = auth
# TODO: it's possible to force through a specific auth method here,
# but no test code for this.
self.timeout = timeout
self.ssl_verify_cert = ssl_verify_cert
self.ssl_cert = ssl_cert
self.url = self.url.unauth()
Expand Down Expand Up @@ -572,6 +574,7 @@ def request(self, url, method="GET", body="", headers={}):
headers=combined_headers,
proxies=proxies,
auth=self.auth,
timeout=self.timeout,
verify=self.ssl_verify_cert,
cert=self.ssl_cert,
)
Expand All @@ -589,6 +592,7 @@ def request(self, url, method="GET", body="", headers={}):
url=str(url),
headers=combined_headers,
proxies=proxies,
timeout=self.timeout,
verify=self.ssl_verify_cert,
cert=self.ssl_cert,
)
Expand Down