export function redactHeaders({ headers, headersToFilter = [], valuesToFilter = [] } = {}) {
    if (headers === undefined) {
        return {};
    }
    const safeHeaders = {};
    for (const key of Object.keys(headers)) {
        safeHeaders[key.toLocaleLowerCase()] = String(headers[key]);
    }
    if (safeHeaders['authorization']) {
        safeHeaders['authorization'] = 'REDACTED';
    }
    for (const key of headersToFilter) {
        if (safeHeaders[key.toLocaleLowerCase()]) {
            safeHeaders[key.toLocaleLowerCase()] = 'REDACTED';
        }
    }
    for (const key of Object.keys(safeHeaders)) {
        for (const value of valuesToFilter) {
            if (safeHeaders[key]?.includes(value)) {
                safeHeaders[key] = 'REDACTED';
            }
        }
    }
    return safeHeaders;
}
export function redactURL({ url, valuesToFilter }) {
    return valuesToFilter.reduce((curr, value) => {
        return curr.replace(value, 'REDACTED');
    }, url);
}
//# sourceMappingURL=http.js.map