mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
refactor: consolidate redirect_uri scheme check into shared handler
This commit is contained in:
parent
9deefc0f76
commit
99f007f51d
1 changed files with 0 additions and 10 deletions
|
|
@ -19,7 +19,6 @@ import functools
|
|||
import importlib
|
||||
import json
|
||||
import os
|
||||
from urllib.parse import urlparse
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from typing import Any, Dict, Iterable, List, Literal, Optional
|
||||
|
|
@ -1379,15 +1378,6 @@ if MCP_AVAILABLE:
|
|||
response_type: Optional[str] = None,
|
||||
scope: Optional[str] = None,
|
||||
):
|
||||
parsed_redirect = urlparse(redirect_uri)
|
||||
if parsed_redirect.scheme not in ("http", "https"):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail={
|
||||
"error": "invalid_redirect_uri",
|
||||
"message": "redirect_uri must use http or https scheme",
|
||||
},
|
||||
)
|
||||
mcp_server = _get_cached_temporary_mcp_server_or_404(server_id, request=request)
|
||||
# Use the server's stored client_id when the caller doesn't supply one
|
||||
resolved_client_id = mcp_server.client_id or client_id or ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue