Skip to content

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

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

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
@github-actions github-actions Bot added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution. This repository only keeps pull requests open when they're linked to an issue that a maintainer has assigned to the author — CONTRIBUTING.md explains why and how we work. This PR has been closed for now because you aren't currently assigned to #3297.

If a maintainer would like this change as a PR from you, they'll assign you to #3297 and this PR will reopen automatically — there's nothing more you need to do. (If you opened the issue, this PR already shows up on its timeline.)

There's no need to open a new PR — this one will be reopened. While it's closed, please push any updates as new commits rather than force-pushing, since GitHub can't reopen a PR whose branch has been rewritten.

Maintainers: reopening this PR, removing the missing-issue-link label, or adding bypass-issue-check bypasses the check.

@github-actions github-actions Bot closed this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resource_url_from_server_url preserves explicit default ports

1 participant