chore: respect server settings from config (#502)

This commit is contained in:
Pavel Feldman
2025-05-30 18:17:51 -07:00
committed by GitHub
parent eec177d3ac
commit 656779531c
4 changed files with 37 additions and 11 deletions

View File

@@ -68,6 +68,7 @@ const defaultConfig: FullConfig = {
allowedOrigins: undefined,
blockedOrigins: undefined,
},
server: {},
outputDir: path.join(os.tmpdir(), 'playwright-mcp-output', sanitizeForFilePath(new Date().toISOString())),
};
@@ -81,6 +82,7 @@ export type FullConfig = Config & {
},
network: NonNullable<Config['network']>,
outputDir: string;
server: NonNullable<Config['server']>,
};
export async function resolveConfig(config: Config): Promise<FullConfig> {
@@ -256,6 +258,10 @@ function mergeConfig(base: FullConfig, overrides: Config): FullConfig {
network: {
...pickDefined(base.network),
...pickDefined(overrides.network),
}
},
server: {
...pickDefined(base.server),
...pickDefined(overrides.server),
},
} as FullConfig;
}