We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bc8261 commit be82661Copy full SHA for be82661
src/mcp/server/auth/routes.py
@@ -1,5 +1,5 @@
1
from collections.abc import Awaitable, Callable
2
-from typing import Any
+from typing import Any, cast
3
4
from pydantic import AnyHttpUrl
5
from starlette.middleware.cors import CORSMiddleware
@@ -32,7 +32,8 @@ def validate_issuer_url(url: AnyHttpUrl):
32
"""
33
34
# 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"):
+ host = cast(str, url.host)
36
+ if url.scheme != "https" and host != "localhost" and not host.startswith("127.0.0.1"):
37
raise ValueError("Issuer URL must be HTTPS")
38
39
# No fragments or query parameters allowed
0 commit comments