Skip to content

Commit 068a92f

Browse files
authored
Merge pull request #471 from microsoft/fix/cae
fix: return error response if CAE claims are not present in WWW-Authenticate header
2 parents 1ba4751 + b86e347 commit 068a92f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/http/httpx/kiota_http/httpx_request_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ async def get_root_parse_node(
427427

428428
def _should_return_none(self, response: httpx.Response) -> bool:
429429
"""Helper function to check if the response should return None.
430-
430+
431431
Conditions:
432432
- The response status code is 204 or 304
433433
- the response content is empty.
@@ -629,7 +629,7 @@ async def retry_cae_response_if_required(
629629
):
630630
claims_match = re.search('claims="([^"]+)"', auth_header_value)
631631
if not claims_match:
632-
raise ValueError("Unable to parse claims from response")
632+
return resp
633633
response_claims = claims_match.group(1)
634634
parent_span.add_event(AUTHENTICATE_CHALLENGED_EVENT_KEY)
635635
parent_span.set_attribute("http.retry_count", 1)

0 commit comments

Comments
 (0)