mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-21 22:15:04 -04:00
initial commit
This commit is contained in:
+6
@@ -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;
|
||||
+11
@@ -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;
|
||||
Reference in New Issue
Block a user