【发布时间】:2022-04-21 05:05:44
【问题描述】:
我想像下面这样在nestjs中禁用X-Powered-By,但它不起作用。
main.ts:
async function bootstrap() {
const logger = new Logger('bootstrap')
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.disable('X-Powered-By') // this line
...
const PORT = process.env.PORT
await app.listen(PORT);
logger.log(`Application is start on port : ${PORT}`)
}
bootstrap();
禁用X-Powered-By 标头后,在接下来的请求中,X-Powered-By 标头仍然存在。
我哪里做错了?
【问题讨论】:
标签: nestjs