@universal-middleware/express 0.4.10 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -185,9 +185,9 @@ function getFullUrl(pathname, req) {
|
|
|
185
185
|
}
|
|
186
186
|
function responseAdapter(nodeResponse, bodyInit) {
|
|
187
187
|
if ([301, 302, 303, 307, 308].includes(nodeResponse.statusCode) && nodeResponse.req) {
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
const fullUrl = getFullUrl(
|
|
188
|
+
const location = nodeResponse.getHeader("location");
|
|
189
|
+
if (location) {
|
|
190
|
+
const fullUrl = getFullUrl(location, nodeResponse.req);
|
|
191
191
|
return Response.redirect(fullUrl, nodeResponse.statusCode);
|
|
192
192
|
}
|
|
193
193
|
}
|