Initial commit

This commit is contained in:
abrendan
2023-11-30 14:15:19 +00:00
commit e4599df811
5457 changed files with 500139 additions and 0 deletions

9
node_modules/expect-ct/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from 'http';
interface ExpectCtOptions {
maxAge?: number;
enforce?: boolean;
reportUri?: string;
}
declare const _default: (options?: ExpectCtOptions | undefined) => (_req: IncomingMessage, res: ServerResponse, next: () => void) => void;
export = _default;

29
node_modules/expect-ct/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
function parseMaxAge(option) {
if (option === undefined) {
return 0;
}
if (typeof option !== 'number' || option < 0) {
throw new Error(option + " is not a valid value for maxAge. Please choose a positive integer.");
}
return option;
}
function getHeaderValueFromOptions(options) {
options = options || {};
var directives = [];
if (options.enforce) {
directives.push('enforce');
}
directives.push("max-age=" + parseMaxAge(options.maxAge));
if (options.reportUri) {
directives.push("report-uri=\"" + options.reportUri + "\"");
}
return directives.join(', ');
}
module.exports = function expectCt(options) {
var headerValue = getHeaderValueFromOptions(options);
return function expectCt(_req, res, next) {
res.setHeader('Expect-CT', headerValue);
next();
};
};