API inicial

This commit is contained in:
2021-03-25 17:23:36 +01:00
commit 218326c402
1878 changed files with 274122 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import { IncomingMessage, ServerResponse } from "http"
export interface XDnsPrefetchControlOptions {
allow?: boolean
}
declare function xDnsPrefetchControl(options?: Readonly<XDnsPrefetchControlOptions>): (_req: IncomingMessage, res: ServerResponse, next: () => void) => void
export default xDnsPrefetchControl

View File

@@ -0,0 +1,11 @@
"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
function xDnsPrefetchControl(options = {}) {
const headerValue = options.allow ? "on" : "off"
return function xDnsPrefetchControlMiddleware(_req, res, next) {
res.setHeader("X-DNS-Prefetch-Control", headerValue)
next()
}
}
module.exports = xDnsPrefetchControl
exports.default = xDnsPrefetchControl