Archived
1
0

Update proxy path passthrough documentation

Includes updated create-react-app docs.

Closes #2565
This commit is contained in:
Anmol Sethi
2021-02-05 02:31:18 -05:00
parent c08e3bb06d
commit 05a0f213a7
2 changed files with 17 additions and 14 deletions

View File

@ -9,8 +9,7 @@ proxy.on("error", (error, _, res) => {
})
// Intercept the response to rewrite absolute redirects against the base path.
// Is disabled when the request has no base path which means --proxy-path-passthrough has
// been enabled.
// Is disabled when the request has no base path which means /absproxy is in use.
proxy.on("proxyRes", (res, req) => {
if (res.headers.location && res.headers.location.startsWith("/") && (req as any).base) {
res.headers.location = (req as any).base + res.headers.location