Nuxt-Notes
Nuxt-Notes copied to clipboard
Nuxt 3 笔记:安全
隐藏 X-Powered-By 响应头
npm i nuxt-security
安装 nuxt-security 模块之后,会自动禁用这个响应头。
export default defineNuxtConfig({
modules: [
'...',
'nuxt-security',
],
})
问题
- 不生效。可能是因为 Nuxt 输出的是全小写的
x-powered-by响应头,而模块源码去除的是X-Powered-By。
相关链接:
- https://nuxt-security.vercel.app/good-practices/hide-x-powered-by-header