-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enforce no trailing slashes in config urls
- Loading branch information
1 parent
d372b3d
commit e99adda
Showing
3 changed files
with
9 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ def test_set_frontend_api(self): | |
project_id="pro-123", | ||
api_secret="corbado1_123", | ||
frontend_api=frontend_api, | ||
backend_api="https://backendapi.cloud.corbado.io/", | ||
backend_api="https://backendapi.cloud.corbado.io", | ||
) | ||
error = False | ||
except ValueError: | ||
|
@@ -24,7 +24,7 @@ def test_set_backend_api(self): | |
for backend_api, valid in self.provide_urls(): | ||
try: | ||
config = Config( | ||
project_id="pro-123", api_secret="corbado1_123", backend_api=backend_api, frontend_api="https://test.com/" | ||
project_id="pro-123", api_secret="corbado1_123", backend_api=backend_api, frontend_api="https://test.com" | ||
) | ||
config.backend_api = backend_api | ||
error = False | ||
|
@@ -33,8 +33,8 @@ def test_set_backend_api(self): | |
self.assertEqual(valid, second=not error) | ||
|
||
def test_get_backend_api(self): | ||
test_url = "https://backendapi.cloud.corbado.io/" | ||
config = Config(project_id="pro-123", api_secret="corbado1_123", frontend_api="https://test.com/", backend_api=test_url) | ||
test_url = "https://backendapi.cloud.corbado.io" | ||
config = Config(project_id="pro-123", api_secret="corbado1_123", frontend_api="https://test.com", backend_api=test_url) | ||
self.assertTrue(config.backend_api.endswith("/v2")) | ||
|
||
def provide_urls(self): | ||
|
@@ -44,6 +44,7 @@ def provide_urls(self): | |
("http://auth.acme.com", False), # Only HTTPS | ||
("https://[email protected]", False), # No user | ||
("https://user:[email protected]", False), # No user no password | ||
("https://auth.acme.com/", False), # No path | ||
("https://auth.acme.com?xxx", False), # No query string | ||
("https://auth.acme.com#xxx", False), # No fragment | ||
("https://auth.acme.com", True), | ||
|
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