Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031import { afterEach, describe, expect, it, vi } from 'vitest';
const originalTrustProxy = process.env.SUBSTRATE_TRUST_PROXY;
afterEach(() => { if (originalTrustProxy === undefined) { delete process.env.SUBSTRATE_TRUST_PROXY; } else { process.env.SUBSTRATE_TRUST_PROXY = originalTrustProxy; } vi.resetModules();});
describe('config security defaults', () => { it('does not trust proxy headers unless explicitly enabled', async () => { delete process.env.SUBSTRATE_TRUST_PROXY; vi.resetModules();
const { CONFIG } = await import('../src/config'); expect(CONFIG.TRUST_PROXY).toBe(false); });
it('allows trusted-proxy mode to be explicitly enabled', async () => { process.env.SUBSTRATE_TRUST_PROXY = 'true'; vi.resetModules();
const { CONFIG } = await import('../src/config'); expect(CONFIG.TRUST_PROXY).toBe(true); });});