Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Chore/1.3.0 #399

Merged
merged 20 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b3a5125
sri: fetch buffers from storage and convert to object
vejja Mar 6, 2024
6e01494
Merge pull request #396 from Baroshem/fix-sri-broken-nuxt-3.9
Baroshem Mar 9, 2024
3af487c
feat-#390: bump unplugin-remove package
Baroshem Mar 9, 2024
df0d711
feat-#397: add note about --host
Baroshem Mar 9, 2024
2dee5d8
Add a feature to enhance FormData.
Mar 12, 2024
057824c
Adding a test case for xssValidator handling formData.
Mar 12, 2024
14893a1
Update docs/content/1.documentation/5.advanced/2.faq.md
Baroshem Mar 14, 2024
89e32ee
feat-#334: bump nuxt-csurf
Baroshem Mar 21, 2024
3ea4017
Merge branch 'chore/1.3.0' of github.com:Baroshem/nuxt-security into …
Baroshem Mar 21, 2024
2d262c5
Merge pull request #401 from Ray0907/main
Baroshem Mar 21, 2024
c4eb39f
chore: small changes
Baroshem Mar 21, 2024
a653b4a
fix: opt in to `import.meta.*` properties
danielroe Mar 25, 2024
3248ea1
fix: set nonce in response headers instead of using configuration
huang-julien Apr 1, 2024
0352fc8
chore: type import
huang-julien Apr 1, 2024
31b1ce2
Merge pull request #406 from danielroe/process-client
Baroshem Apr 2, 2024
c1e8bd8
Merge pull request #408 from huang-julien/fix/remove_runtime_headers_…
Baroshem Apr 2, 2024
1aa9307
docs: use new `nuxi module add` command in installation
danielroe Apr 3, 2024
41cdbfb
docs: easier instructions
Baroshem Apr 3, 2024
eaaf6de
Merge pull request #410 from danielroe/module-installation
Baroshem Apr 3, 2024
56b6ed2
chore: release 1.3.0
Baroshem Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/content/1.documentation/5.advanced/2.faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,26 @@ Alternatively, you can use the `external` attribute on `NuxtLink` to set the nav
::alert{type="info"}
ℹ Read more about it [here](https://github.com/Baroshem/nuxt-security/issues/228).
::

### Running app with `--host` flag

If you want to expose your app in local network to test it by using other devices you can do so by adding the following configuration:

```ts
security: {
headers: {
crossOriginEmbedderPolicy: process.env.NODE_ENV === 'development' ? 'unsafe-none' : 'require-corp', //https://github.com/Baroshem/nuxt-security/issues/101
strictTransportSecurity: true,
contentSecurityPolicy: {
"upgrade-insecure-requests": process.env.NODE_ENV === 'development' ? false : true // USE ONLY IN DEV MODE
}
},
corsHandler: {
origin:'*'
}
}
```

::alert{type="info"}
ℹ Read more about it [here](https://github.com/Baroshem/nuxt-security/issues/397).
::
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@
},
"packageManager": "yarn@1.22.19",
"dependencies": {
"@nuxt/kit": "^3.8.0",
"@nuxt/kit": "^3.10.3",
"basic-auth": "^2.0.1",
"cheerio": "^1.0.0-rc.12",
"defu": "^6.1.1",
"nuxt-csurf": "^1.3.1",
"pathe": "^1.0.0",
"unplugin-remove": "^0.1.7",
"unplugin-remove": "^1.0.0",
"xss": "^1.0.14"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.2.0",
"@nuxt/module-builder": "^0.5.2",
"@nuxt/schema": "^3.8.0",
"@nuxt/test-utils": "^3.8.0",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.10.3",
"@nuxt/test-utils": "^3.11.0",
"@types/node": "^18.18.1",
"eslint": "^8.50.0",
"nuxt": "^3.8.0",
"nuxt": "^3.10.3",
"typescript": "^5.2.2",
"vitest": "^1.0.4"
"vitest": "^1.3.1"
},
"stackblitz": {
"installDependencies": false,
Expand Down
7 changes: 4 additions & 3 deletions src/runtime/nitro/plugins/03-subresourceIntegrity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ export default defineNitroPlugin((nitroApp) => {
//
// - Conversely, if we are in a standalone SSR server pre-built by nuxi build
// Then we don't have a .nuxt build directory anymore
// But we did save the /integrity directory into the server assets
// But we did save the /integrity directory into the server assets
const prerendering = isPrerendering(event)
const storageBase = prerendering ? 'build' : 'assets'
const sriHashes: Record<string, string> = await useStorage(storageBase).getItem('integrity:sriHashes.json') || {}
const storageBase = prerendering ? 'build' : 'assets'
const sriHashesRaw = await useStorage(storageBase).getItemRaw<Uint8Array>('integrity:sriHashes.json')
const sriHashes: Record<string, string> = sriHashesRaw ? JSON.parse(new TextDecoder().decode(sriHashesRaw)) : {}

// Scan all relevant sections of the NuxtRenderHtmlContext
// Note: integrity can only be set on scripts and on links with rel preload, modulepreload and stylesheet
Expand Down
Loading
Loading