fix(maas-provider): validate Claude custom URL strictly and surface FastAPI detail message - #1412
Conversation
…astAPI detail message
There was a problem hiding this comment.
Code Review
This pull request introduces validation logic for Claude custom URLs to ensure they are absolute HTTP(S) URLs without credentials, query parameters, or fragments, and updates the global request error handler to better parse FastAPI validation errors. The review suggests simplifying the URL validation logic by reusing existing utilities and improving the robustness of the error handler to support string-based detail messages.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
URL validation and provider-specific FastAPI error selection remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Tightens Claude custom URL validation and improves FastAPI validation error display.
Changes:
- Rejects credentials, queries, and fragments in Claude URLs.
- Extracts FastAPI detail messages.
- Adds localized validation messages.
| File | Review |
|---|---|
src/request-config.tsx |
FastAPI error selection can surface an unrelated provider error. |
src/pages/maas-provider/hooks/use-provider-required-fields.tsx |
URL validation still accepts malformed absolute URLs rejected by the backend. |
src/locales/zh-CN/provider.ts |
Adds Chinese validation messages. |
src/locales/tr-TR/provider.ts |
Adds Turkish validation messages. |
src/locales/ru-RU/provider.ts |
Adds Russian validation messages. |
src/locales/ja-JP/provider.ts |
Adds Japanese validation messages. |
src/locales/en-US/provider.ts |
Adds English validation messages. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Refer to issue: