Skip to content

Commit 6763145

Browse files
committed
fix: return correct resource location on PUT and POST requests
1 parent c51fc9a commit 6763145

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scim2_server/provider.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def adjust_location(
125125
126126
:param request: The werkzeug request object
127127
:param resource: The resource to modify
128-
:param cp: Whether or not to return a modified copy of the
129-
resource or to modify the resource in-place.
128+
:param cp: Whether to return a modified copy of the resource or
129+
to modify the resource in-place.
130130
"""
131131
location = urljoin(request.url + "/", resource.meta.location)
132132
if cp:
@@ -200,6 +200,7 @@ def call_single_resource(
200200
).model_validate(request.json)
201201
merge_resources(resource, updated_attributes)
202202
updated = self.backend.update_resource(resource_type.id, resource)
203+
self.adjust_location(request, updated)
203204
return self.make_response(
204205
updated.model_dump(
205206
scim_ctx=Context.RESOURCE_REPLACEMENT_RESPONSE,
@@ -229,6 +230,7 @@ def call_single_resource(
229230
updated = self.backend.update_resource(resource_type.id, resource)
230231

231232
if response_args:
233+
self.adjust_location(request, updated)
232234
return self.make_response(
233235
updated.model_dump(
234236
scim_ctx=Context.RESOURCE_REPLACEMENT_RESPONSE,

0 commit comments

Comments
 (0)