You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
843 B

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)
}
}
}