Skip to content

Remove lstrip in each OAuth endpoint #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mcp/server/auth/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ def build_metadata(
revocation_options: RevocationOptions,
) -> OAuthMetadata:
authorization_url = modify_url_path(
issuer_url, lambda path: path.rstrip("/") + AUTHORIZATION_PATH.lstrip("/")
issuer_url, lambda path: path.rstrip("/") + AUTHORIZATION_PATH
)
token_url = modify_url_path(
issuer_url, lambda path: path.rstrip("/") + TOKEN_PATH.lstrip("/")
issuer_url, lambda path: path.rstrip("/") + TOKEN_PATH
)
# Create metadata
metadata = OAuthMetadata(
Expand All @@ -194,13 +194,13 @@ def build_metadata(
# Add registration endpoint if supported
if client_registration_options.enabled:
metadata.registration_endpoint = modify_url_path(
issuer_url, lambda path: path.rstrip("/") + REGISTRATION_PATH.lstrip("/")
issuer_url, lambda path: path.rstrip("/") + REGISTRATION_PATH
)

# Add revocation endpoint if supported
if revocation_options.enabled:
metadata.revocation_endpoint = modify_url_path(
issuer_url, lambda path: path.rstrip("/") + REVOCATION_PATH.lstrip("/")
issuer_url, lambda path: path.rstrip("/") + REVOCATION_PATH
)
metadata.revocation_endpoint_auth_methods_supported = ["client_secret_post"]

Expand Down
Loading