Preserve remote URL casing in texture lookup normalization#10013
Open
binbonn wants to merge 10 commits intoFacepunch:masterfrom
Open
Preserve remote URL casing in texture lookup normalization#10013binbonn wants to merge 10 commits intoFacepunch:masterfrom
binbonn wants to merge 10 commits intoFacepunch:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes texture loading/caching behavior so that remote http/https image URLs and data: URIs are no longer lowercased during texture-path normalization, preventing failures when remote paths are case-sensitive (Issue #9986).
Changes:
- Introduced
NormalizeLookupPathto centralize texture cache key normalization. - Preserved casing for
http/httpsURLs anddata:URIs while keeping local file paths normalized/lowercased. - Applied the same normalization logic in both
LoadInternalandFindto keep cache insert/lookup consistent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a texture loading issue where
<img src="...">URLs could be lowercased during texture path normalization.Some remote image paths are case-sensitive, so this could break valid image URLs.
Motivation & Context
Remote URLs and data URIs should preserve their original casing.
The previous normalization path applied lowercase rules intended for local file paths to all texture inputs.
Fixes: #9986
Implementation Details
NormalizeLookupPathinTexture.Load.csto centralize lookup normalization behavior.http/httpsURLsdata:URIsLoadInternal(load/cache insert path)Find(cache lookup path)This keeps cache behavior consistent while preventing URL casing regressions.
Screenshots / Videos (if applicable)
N/A (non-visual fix)
Checklist