Preserve empty URL paths on OAuth metadata models (#2925)

This commit is contained in:
Marcelo Trylesinski 2026-06-20 16:32:03 +01:00 • committed by GitHub
commit b7a5bffed0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -517,10 +517,10 @@ class TestOAuthFallback:
}"""
response = httpx.Response(200, content=content)
# Should set metadata
# Should set metadata; the empty path is preserved (no trailing slash added)
await oauth_provider._handle_oauth_metadata_response(response)
assert oauth_provider.context.oauth_metadata is not None
assert str(oauth_provider.context.oauth_metadata.issuer) == "https://auth.example.com/"
assert str(oauth_provider.context.oauth_metadata.issuer) == "https://auth.example.com"
@pytest.mark.anyio
async def test_prioritize_www_auth_scope_over_prm(