fix(parse): recognize mixed-case resource URL schemes#3474
fix(parse): recognize mixed-case resource URL schemes#3474patrick-andstar wants to merge 1 commit into
Conversation
huangruiteng
left a comment
There was a problem hiding this comment.
Blocking: the UnderstandingAPI route still performs case-sensitive HTTP(S) scheme checks.
When parser_api is enabled, UnifiedResourceProcessor recognizes a mixed-case Feishu URL and bypasses FeishuAccessor, but UnderstandingAPI.parse classifies its candidate with a case-sensitive startswith check. UnderstandingAPI.submit_url has the same check. As a result, an input such as HTTPS://example.larkoffice.com/docx/unit-test-token is recognized as Feishu by FeishuAccessor._is_feishu_url, yet parse treats it as an invalid local path and submit_url rejects it before any network call.
Please make the scheme checks in both UnderstandingAPI.parse and UnderstandingAPI.submit_url case-insensitive, while preserving the original URL passed to the provider, and add regression coverage for both entry points. The existing 23 parser-API tests pass, but none covers this mixed-case path.
Description
RFC 3986 defines URI schemes as case-insensitive. Mixed-case HTTP(S) resource URLs were treated as local paths or skipped by accessor routing, and a mixed-case Feishu URL could fall through to the generic HTTP accessor. This change normalizes scheme comparisons only, while preserving the original URL for client calls, metadata, and remote-target validation.
Human Involvement
Related Issue
None. This is a discovery-backed regression fix; no matching open issue was found.
Type of Change
Changes Made
Testing
Executed locally:
RegistryRoutingcases that require a localov.conf.tests/server/test_api_local_input_security.py -k remote_resource_scheme_is_case_insensitive: 1 passed.tests/misc/test_network_guard.py: 66 passed.git diff --checkpassed for all changed files.Checklist
Screenshots (if applicable)
Not applicable.
Additional Notes
google.genaidependency. The MCP server fixture also requires a localov.conf.openviking/parse/accessors/feishu_accessor.py:83andtests/unit/test_accessors_http.py:274). Restricted Mypy reports six pre-existing diagnostics outside this diff.mixed-case URL scheme HTTP HTTPS accessor Feishu RFC 3986. Adjacent open PRs fix(utils): normalize trailing-dot/case in code-hosting host matching #2749, fix: support OAuth GitLab repository archives #3347, fix(parse): normalize WebFeed entry URLs #3472, and refactor(parse): 收口资源解析路由 #3295 were reviewed; none implements case-insensitive URI scheme routing.