You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/1.getting-started/3.usage.md
+56-48Lines changed: 56 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,12 @@ title: Usage
3
3
description: Learn how to use headers and middleware both globally and per route.
4
4
---
5
5
6
+
7
+
6
8
Nuxt Security by default registers a set of **global** Nuxt `routeRules` that will make your application more secure by default. Both headers and middleware can be easily configured and even disabled when needed.
7
9
8
10
::callout{icon="i-heroicons-light-bulb"}
9
-
Read more about security headers [here](https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html#use-appropriate-security-headers).
11
+
Read more about security headers [here](https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html#use-appropriate-security-headers).
10
12
::
11
13
12
14
## Global configuration
@@ -71,6 +73,7 @@ If your application defines conflicting headers at both levels, the `security` p
71
73
72
74
For more information on `routeRules` please see the [Nuxt documentation](https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering)
73
75
76
+
74
77
## Runtime hooks
75
78
76
79
If you need to change the configuration at runtime, it is possible to do it through the `nuxt-security:routeRules` hook.
Copy file name to clipboardExpand all lines: docs/content/3.middleware/4.cors-handler.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: CORS Handler
3
-
description: Set rules for Cross Origin Resource Sharing.
3
+
description: Set roules for Cross Origin Resource Sharing.
4
4
links:
5
5
- label: Enabled
6
6
icon: i-heroicons-check-badge
@@ -11,7 +11,7 @@ links:
11
11
This middleware will help you set your CORS options and it is based on built in [H3 CORS](https://github.com/unjs/h3) functionality
12
12
13
13
::callout{icon="i-heroicons-light-bulb"}
14
-
Read more about Cross Origin Resource Sharing [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
14
+
Read more about Cross Origin Resource Sharing [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
15
15
::
16
16
17
17
Testing CORS configuration can be done by running one application with NuxtSecurity enabled and creating a second application (that is running on a different port) that will send a request to the first app. Then, a CORS error could be easily observed that proves that CORS is working as expected.
0 commit comments