-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for #289 - basic auth broken for some servers
- Loading branch information
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1175,3 +1175,19 @@ def testContextManager(self): | |
cal_url = "http://me:[email protected]:80/" | ||
with DAVClient(url=cal_url) as client_ctx_mgr: | ||
assert isinstance(client_ctx_mgr, DAVClient) | ||
|
||
def testExtractAuth(self): | ||
""" | ||
ref https://github.com/python-caldav/caldav/issues/289 | ||
""" | ||
cal_url = "http://me:[email protected]:80/" | ||
with DAVClient(url=cal_url) as client: | ||
assert client.extract_auth_types("Basic\n") == ["basic"] | ||
assert client.extract_auth_types("Basic") == ["basic"] | ||
assert client.extract_auth_types('Basic Realm=foo;charset="UTF-8"') == [ | ||
"basic" | ||
] | ||
assert client.extract_auth_types("Basic,dIGEST Realm=foo") == [ | ||
"basic", | ||
"digest", | ||
] |