Skip to content

Commit b553533

Browse files
committed
feat: TestSCIMClient can handle absolute URLs
1 parent 03fc972 commit b553533

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
Added
5+
^^^^^
6+
- :class:`~scim2_client.engines.werkzeug.TestSCIMClient` can handle absolute URLs.
7+
48
Changed
59
^^^^^^^
610
- Avoid to initialize :paramref:`~scim2_client.SCIMClient.resource_models` with configuration resources.

scim2_client/engines/werkzeug.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,17 @@ def __init__(self, app, *args, scim_prefix: str = "", **kwargs):
7272
self.scim_prefix = scim_prefix
7373

7474
def make_url(self, url: Optional[str]) -> str:
75+
url = url or ""
7576
prefix = (
7677
self.scim_prefix[:-1]
7778
if self.scim_prefix.endswith("/")
7879
else self.scim_prefix
7980
)
80-
return f"{prefix}{url or ''}"
81+
return (
82+
url
83+
if url.startswith("http://") or url.startswith("https://")
84+
else f"{prefix}{url}"
85+
)
8186

8287
def create(
8388
self,

0 commit comments

Comments
 (0)