[flutter_tools] Restrict WebAssetServer source resolution to source map extensions (#191501)
## Description Restricts `_resolveDartFile` in `WebAssetServer` to only resolve files with source map extensions (`.dart`, `.map`) from the project root, package, and SDK paths, aligning behavior with `ReleaseAssetServer`. Previously, `WebAssetServer._resolveDartFile` attempted to resolve any relative path directly against `fileSystem.currentDirectory`, which caused raw project files (such as `<root>/assets/...`) to be served directly with HTTP 200 when requested by debug web runtime asset loaders, masking invalid asset key references that failed on release web and native platforms. ## Issues Fixed Fixes #84346 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
B
Ben Konyi committed
7c0cceaea984294d4845b32fddd5b2912cf0594e
Parent: 9df0f58
Committed by GitHub <noreply@github.com>
on 8/21/2026, 9:37:08 PM