Skip to content

Compare URL schemes case-insensitively in isLocalResource - #887

Merged
kean merged 1 commit into
mainfrom
fix/case-insensitive-url-scheme
Aug 15, 2026
Merged

kean merged 1 commit into
mainfrom
fix/case-insensitive-url-scheme

Conversation

@kean

@kean kean commented Aug 15, 2026

Copy link
Copy Markdown
Owner

URL.isLocalResource compared scheme against "file"/"data" with ==, but URI schemes are case-insensitive (RFC 3986). URLs such as FILE://… or Data:… were therefore treated as remote: they were loaded through the data loader instead of read directly, and their bytes were duplicated into DataCache.

The comparison is now case-insensitive. Adds unit tests for isLocalResource and pipeline tests asserting that FILE:// and DATA: URLs skip the data loader and are not written to the disk cache.

URI schemes are case-insensitive (RFC 3986), so URLs like FILE:// or Data:
were not recognized as local resources: they went through the data loader and
their bytes were duplicated into the disk cache.
@kean
kean merged commit ef61eef into main Aug 15, 2026
5 checks passed
@kean
kean deleted the fix/case-insensitive-url-scheme branch August 15, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant