Add mounting for activated routes, route compiling, routing
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
import {HTTPKernelModule} from "../HTTPKernelModule";
|
||||
import {Request} from "../../lifecycle/Request";
|
||||
import {Injectable} from "@extollo/di"
|
||||
import {Injectable, Inject} from "@extollo/di"
|
||||
import {HTTPKernel} from "../HTTPKernel";
|
||||
import {Config} from "../../../service/Config";
|
||||
|
||||
@Injectable()
|
||||
export class PoweredByHeaderInjectionHTTPModule extends HTTPKernelModule {
|
||||
@Inject()
|
||||
protected readonly config!: Config;
|
||||
|
||||
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')
|
||||
if ( !this.config.get('server.poweredBy.hide', false) ) {
|
||||
request.response.setHeader('X-Powered-By', this.config.get('server.poweredBy.header', 'Extollo'))
|
||||
}
|
||||
|
||||
return request
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user