mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
Fix: Handle empty strings in OAuth registration response (#19144)
- The mcp package requires optional unset values to be None. If an empty string is passed, it gets validated and fails. - Replace all empty strings with None.
This commit is contained in:
parent
ad17d35ac4
commit
3207998114
1 changed files with 4 additions and 0 deletions
|
|
@ -330,6 +330,10 @@ async def get_oauth_client_info_with_dynamic_client_registration(
|
|||
registration_response_json = (
|
||||
await oauth_client_registration_response.json()
|
||||
)
|
||||
|
||||
# The mcp package requires optional unset values to be None. If an empty string is passed, it gets validated and fails.
|
||||
# This replaces all empty strings with None.
|
||||
registration_response_json = {k: (None if v == "" else v) for k, v in registration_response_json.items()}
|
||||
oauth_client_info = OAuthClientInformationFull.model_validate(
|
||||
{
|
||||
**registration_response_json,
|
||||
|
|
|
|||
Loading…
Reference in a new issue