Skip to content

Respect explicit conneg config when auto-enabling for mashlib - #128

Closed
melvincarvalho with Copilot wants to merge 2 commits into
issue-22-mashlib-auto-connegfrom
copilot/sub-pr-127
Closed

Respect explicit conneg config when auto-enabling for mashlib#128
melvincarvalho with Copilot wants to merge 2 commits into
issue-22-mashlib-auto-connegfrom
copilot/sub-pr-127

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

When mashlib/mashlibCdn was enabled, conneg was unconditionally forced to true, silently overriding explicit user configuration (--conneg=false, JSS_CONNEG=false, or "conneg": false in config file).

Changes

  • src/config.js: Auto-enable conneg only when it hasn't been explicitly set in any config source (CLI, env vars, or config file)
    • Extracts cliConfig = filterUndefined(cliOptions) once, reusing it for both the merge and the explicit-set check
    • Checks presence of conneg key across all three user-provided sources before applying the default
// Before: unconditional override
if (config.mashlib || config.mashlibCdn) {
  config.conneg = true;
}

// After: only auto-enable when user hasn't explicitly configured it
const cliConfig = filterUndefined(cliOptions);
const config = { ...defaults, ...fileConfig, ...envConfig, ...cliConfig };
// ...
const connegExplicitlySet = 'conneg' in fileConfig || 'conneg' in envConfig || 'conneg' in cliConfig;
if ((config.mashlib || config.mashlibCdn) && !connegExplicitlySet) {
  config.conneg = true;
}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

… is enabled

Co-authored-by: melvincarvalho <65864+melvincarvalho@users.noreply.github.com>
Copilot AI changed the title [WIP] Update auto-enable conneg implementation with feedback Respect explicit conneg config when auto-enabling for mashlib Feb 24, 2026
@melvincarvalho

Copy link
Copy Markdown
Contributor

Probably overkill for this change

@melvincarvalho
melvincarvalho deleted the copilot/sub-pr-127 branch February 24, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants