import LifecycleUnit from "../lifecycle/Unit.ts"; import {Unit} from "../lifecycle/decorators.ts"; import Kernel from "../http/kernel/Kernel.ts"; import PrepareRequest from "../http/kernel/module/PrepareRequest.ts"; import SetSessionCookie from "../http/kernel/module/SetSessionCookie.ts"; import Config from "./Config.ts"; import SetDatonHeaders from "../http/kernel/module/SetDatonHeaders.ts"; @Unit() export default class HttpKernel extends LifecycleUnit { constructor( protected readonly kernel: Kernel, protected readonly config: Config, ) { super() } public async up() { PrepareRequest.register(this.kernel) SetSessionCookie.register(this.kernel) if ( this.config.get('server.powered_by.enable') ) { SetDatonHeaders.register(this.kernel) } } }