Add kernel modules and basic kernel handling
This commit is contained in:
17
src/http/kernel/module/PoweredByHeaderInjectionHTTPModule.ts
Normal file
17
src/http/kernel/module/PoweredByHeaderInjectionHTTPModule.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import {HTTPKernelModule} from "../HTTPKernelModule";
|
||||
import {Request} from "../../lifecycle/Request";
|
||||
import {Injectable} from "@extollo/di"
|
||||
import {HTTPKernel} from "../HTTPKernel";
|
||||
|
||||
@Injectable()
|
||||
export class PoweredByHeaderInjectionHTTPModule extends HTTPKernelModule {
|
||||
public static register(kernel: HTTPKernel) {
|
||||
kernel.register(this).after()
|
||||
}
|
||||
|
||||
public async apply(request: Request) {
|
||||
// FIXME make this configurable
|
||||
request.response.setHeader('X-Powered-By', 'Extollo')
|
||||
return request
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user