Skip to content

fix(auth): normalize default resource URL ports - #3299

Open
DebadityaHait wants to merge 2 commits into
modelcontextprotocol:mainfrom
DebadityaHait:fix/resource-url-default-port
Open

fix(auth): normalize default resource URL ports#3299
DebadityaHait wants to merge 2 commits into
modelcontextprotocol:mainfrom
DebadityaHait:fix/resource-url-default-port

Conversation

@DebadityaHait

Copy link
Copy Markdown

Summary

  • Normalize explicit HTTP port 80 and HTTPS port 443 when canonicalizing resource URLs.
  • Preserve non-default ports, existing URL components, and authority edge cases.

Fixes #3297

Testing

  • uv run --frozen pytest tests/shared/test_auth_utils.py (19 passed)
  • uv run --frozen pyright src/mcp/shared/auth_utils.py tests/shared/test_auth_utils.py (0 errors)
  • uv run --frozen ruff check .
  • uv run --frozen ruff format --check .
  • Full coverage/matrix checks delegated to CI because the local Windows environment has no Bash; bash scripts/test could not run.

AI assistance

AI assistance was used during investigation and implementation. I reviewed the change, reproduced the issue, and understand the code and tests being submitted.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/mcp/shared/auth_utils.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resource_url_from_server_url preserves explicit default ports

1 participant