Skip to content

Commit af930bd

Browse files
committed
chore: grammar
1 parent bba56fb commit af930bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/api/middleware/cors.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,20 @@ This way, the CORS middleware allows you to control how your Fiber application r
132132

133133
When configuring CORS, misconfiguration can potentially expose your application to various security risks.
134134

135-
- **Allowing all origins:** Setting `Access-Control-Allow-Origin` to `*` (a wildcard) allows any domain to make cross-origin requests. This can expose your application to cross-site request forgery (CSRF) attacks. It's generally safer to specify the exact domains that are allowed to make requests.
135+
- **Allowing all origins:** Setting `Access-Control-Allow-Origin` to `*` (a wildcard) allows any domain to make cross-origin requests. This can expose your application to cross-site request forgery (CSRF) attacks. It's generally safer to specify the exact domains allowed to make requests.
136136

137137
- **Allowing credentials:** The `Access-Control-Allow-Credentials` header indicates whether the browser should include credentials with cross-origin requests. If this is set to `true`, it can expose your application to attacks if combined with a wildcard `Access-Control-Allow-Origin`. We specifically prohibit this action in our CORS middleware, in line with the Fetch specification.
138138

139139
- **Exposing headers:** The `Access-Control-Expose-Headers` header lets the server whitelist headers that browsers are allowed to access. Be careful not to expose sensitive headers.
140140

141141
:::note
142-
In our CORS middleware, we specifically prevent `Access-Control-Allow-Credentials` from being `true` when `Access-Control-Allow-Origin` is set to the wildcard (`*`). This is to prevent potential security risks associated with allowing credentials to be shared with all origins.
142+
In our CORS middleware, we specifically prevent `Access-Control-Allow-Credentials` from being `true` when `Access-Control-Allow-Origin` is set to the wildcard (`*`). This prevents potential security risks associated with allowing credentials to be shared with all origins.
143143

144144
When using `AllowOrigins`, a configuration check will cause a panic if `Access-Control-Allow-Credentials` is `true` and `Access-Control-Allow-Origin` is set to the wildcard.
145145
:::
146146

147147
:::caution
148148
Be extra careful when using `AllowOriginsFunc`. Make sure to properly validate the origin to prevent potential security risks.
149149

150-
When using `AllowOriginsFunc`, the `Access-Control-Allow-Origin` header will always be set to the origin header if the func returns `true`, which can bypass such protections if you simply return `true` in all situations.
150+
When using `AllowOriginsFunc`, the `Access-Control-Allow-Origin` header will always be set to the origin header if the func returns `true`, which can bypass such protections if you return `true` in all situations.
151151
:::

0 commit comments

Comments
 (0)