mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix slash in chromium path. (flutter/engine#51527)
The previous code here introduced an extra slash. Our test platform was tolerant to this extra slash and essentially ignored it, but this probably won't work for most hosting solutions. I went ahead and added some extra validation to the URL when fetching so that we won't serve URLs that have the double slash in their path, in order to catch this if it regresses again.
This commit is contained in:
parent
1b0240f093
commit
7aa5194894
@ -485,7 +485,7 @@ class BrowserPlatform extends PlatformPlugin {
|
||||
request.url.path,
|
||||
));
|
||||
|
||||
if (!fileInDirectory.existsSync()) {
|
||||
if (request.url.path.contains('//') || !fileInDirectory.existsSync()) {
|
||||
return shelf.Response.notFound('File not found: ${request.url.path}');
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ export const loadCanvasKit = (deps, config, browserEnvironment, engineRevision)
|
||||
const useChromiumCanvasKit = supportsChromiumCanvasKit && (config.canvasKitVariant !== "full");
|
||||
let baseUrl = config.canvasKitBaseUrl ?? `https://www.gstatic.com/flutter-canvaskit/${engineRevision}/`;
|
||||
if (useChromiumCanvasKit) {
|
||||
baseUrl = `${baseUrl}/chromium/`;
|
||||
baseUrl = `${baseUrl}chromium/`;
|
||||
}
|
||||
let canvasKitUrl = `${baseUrl}canvaskit.js`;
|
||||
if (deps.flutterTT.policy) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user