mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: do not use fallback download URLs if custom baseUrl is provided (#12206)
This commit is contained in:
parent
4ec0280080
commit
ab560bcf6f
@ -92,6 +92,11 @@ export interface InstallOptions {
|
|||||||
* @defaultValue `true`
|
* @defaultValue `true`
|
||||||
*/
|
*/
|
||||||
unpack?: boolean;
|
unpack?: boolean;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
|
forceFallbackForTesting?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,6 +130,10 @@ export async function install(
|
|||||||
try {
|
try {
|
||||||
return await installUrl(url, options);
|
return await installUrl(url, options);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
// If custom baseUrl is provided, do not fall back to CfT dashboard.
|
||||||
|
if (options.baseUrl && !options.forceFallbackForTesting) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
debugInstall(`Error downloading from ${url}.`);
|
debugInstall(`Error downloading from ${url}.`);
|
||||||
switch (options.browser) {
|
switch (options.browser) {
|
||||||
case Browser.CHROME:
|
case Browser.CHROME:
|
||||||
|
@ -151,6 +151,7 @@ describe('Chrome install', () => {
|
|||||||
platform: BrowserPlatform.LINUX,
|
platform: BrowserPlatform.LINUX,
|
||||||
buildId: testChromeBuildId,
|
buildId: testChromeBuildId,
|
||||||
baseUrl: 'https://127.0.0.1',
|
baseUrl: 'https://127.0.0.1',
|
||||||
|
forceFallbackForTesting: true,
|
||||||
});
|
});
|
||||||
assert.strictEqual(fs.existsSync(expectedOutputPath), true);
|
assert.strictEqual(fs.existsSync(expectedOutputPath), true);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user