Add TLS feature with Caddy
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
type Params = {
|
||||
text?: string | null;
|
||||
secrets: string[];
|
||||
};
|
||||
|
||||
export default function redactSecrets({ text, secrets }: Params) {
|
||||
let output = text || "";
|
||||
|
||||
for (let i = 0; i < secrets.length; i++) {
|
||||
const secret = secrets[i];
|
||||
|
||||
if (secret && secret.length >= 4) {
|
||||
output = output.split(secret).join(`[redacted]`);
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user