docs: forward allow-listed headers and catch fetch errors in BFF proxy example (#100808)
## Summary The "Proxying to a backend" example in the Backend for Frontend guide built the upstream request with `new Request(proxyURL, request)`, which forwards every incoming header, including `Cookie` and `Authorization`, to the external backend. The example now forwards an allow-list (`accept`, `content-type`), and the intro says why. It also returned `fetch()` without `await` inside `try`, so a rejected fetch skipped the `catch` and the 500 fallback never ran. It now uses `return await fetch(proxyRequest)`. - docs: forward allow-listed headers and catch fetch errors in BFF proxy example <!-- NEXT_JS_LLM -->
Showing
Please
register
or
sign in
to comment