Skip to content

Commit be82661

Browse files
committed
Fix pre-commit
1 parent 0bc8261 commit be82661

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mcp/server/auth/routes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Awaitable, Callable
2-
from typing import Any
2+
from typing import Any, cast
33

44
from pydantic import AnyHttpUrl
55
from starlette.middleware.cors import CORSMiddleware
@@ -32,7 +32,8 @@ def validate_issuer_url(url: AnyHttpUrl):
3232
"""
3333

3434
# RFC 8414 requires HTTPS, but we allow localhost HTTP for testing
35-
if url.scheme != "https" and url.host != "localhost" and not url.host.startswith("127.0.0.1"):
35+
host = cast(str, url.host)
36+
if url.scheme != "https" and host != "localhost" and not host.startswith("127.0.0.1"):
3637
raise ValueError("Issuer URL must be HTTPS")
3738

3839
# No fragments or query parameters allowed

0 commit comments

Comments
 (0)