const express = require("express"); const { NetHelperModule } = global.moduleApi; const HTTPServer = require("../components/_http"); module.exports = class CgiBanPage extends NetHelperModule { constructor() { super(); this.router = express.Router(); this.cgiban = new this.statics.Operator( "cgiban", (argv) => { return argv.length === 0; }, (argv, self, syntaxTree) => { if (!(syntaxTree.Type.prototype instanceof HTTPServer)) { throw new SyntaxError("Unsupported type of server"); } const router = this.router; router.use("/cgi-bin/*", (req, res, next) => { res .status(400) .send( "
Perl is the language of dinosaurs and faggots, shove your query up your ass, piece of shit
", ); }); router.use("*", (req, res, n) => n()); }, ); this.operators.push(this.cgiban); this.emit("runned", () => { this.serverType.app.use(router); }); } bind(type) { super.bind(type); this.serverType.routelist.push(this.router); } };