Unverified Commit abec161a authored by Swarnava Sengupta's avatar Swarnava Sengupta Committed by GitHub

Update Proxy docs (#85439)

Looks like `_next/data` is always matched to prevent accidental security
issues with protecting the page but not the data route. Documenting
using this PR
parent 94caeadf
......@@ -620,6 +620,19 @@ export const config = {
}
```
> **Good to know**:
>
> - Even when `_next/data` is excluded in a negative matcher pattern, proxy will still be invoked for `_next/data` routes. This is intentional behavior to prevent accidental security issues where you might protect a page but forget to protect the corresponding data route.
```js filename="proxy.js"
export const config = {
matcher:
'/((?!api|_next/data|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)',
}
// Proxy will still run for /_next/data/* routes despite being excluded
```
### `waitUntil` and `NextFetchEvent`
The `NextFetchEvent` object extends the native [`FetchEvent`](https://developer.mozilla.org/docs/Web/API/FetchEvent) object, and includes the [`waitUntil()`](https://developer.mozilla.org/docs/Web/API/ExtendableEvent/waitUntil) method.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment