@springernature/backend-proxy
Advanced tools
Comparing version 1.3.1 to 1.3.2
# History | ||
## 1.3.2 | ||
_26/02/20_ | ||
- Fixes `location` header rewriting to only rewrite the host ([springerBuck](https://github.com/springerBuck)) | ||
## 1.3.1 | ||
@@ -4,0 +9,0 @@ _18/02/20_ |
{ | ||
"name": "@springernature/backend-proxy", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Proxies frontend requests to a backend and can render the result", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -83,7 +83,7 @@ const http = require('http'); | ||
if (backendResponse.statusCode >= 300 && backendResponse.statusCode <= 399 && | ||
backendResponse.headers.location && | ||
backendResponse.headers.location.startsWith(options.backend)) { | ||
let locationUrl = new url.URL(backendResponse.headers.location); | ||
backendResponse.headers.location = locationUrl.pathname + locationUrl.search + locationUrl.hash; | ||
if (backendResponse.statusCode >= 300 && backendResponse.statusCode <= 399 && backendResponse.headers.location) { | ||
if (backendResponse.headers.location.includes(backendHttpOptions.host)) { | ||
const locationUrl = new url.URL(backendResponse.headers.location); | ||
backendResponse.headers.location = locationUrl.pathname + locationUrl.search + locationUrl.hash; | ||
} | ||
} | ||
@@ -90,0 +90,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16942