@murasoftware/next-core
Advanced tools
Comparing version 2.0.14 to 2.0.15
@@ -763,6 +763,7 @@ import { useEffect, useState, createContext } from 'react'; | ||
if (content.redirect) { | ||
//match casing of nodeProxyRedirectCasing in mura.js | ||
var hasResponseHeaders = typeof context.res.getHeaders != 'undefined'; //match casing of nodeProxyRedirectCasing in mura.js | ||
//Don't set status code is cookies are coming. 30X will cause them to be ignored | ||
//The browser will handle the redirect | ||
var hasSetCookie = Object.keys(context.res.getHeaders()).findIndex(function (key) { | ||
var hasSetCookie = hasResponseHeaders && Object.keys(context.res.getHeaders()).findIndex(function (key) { | ||
return key.toLowerCase() == 'set-cookie'; | ||
@@ -772,3 +773,5 @@ }) > -1; | ||
if (!hasSetCookie) { | ||
context.res.setHeader('Location', content.redirect); | ||
if (hasResponseHeaders) { | ||
context.res.setHeader('Location', content.redirect); | ||
} | ||
@@ -782,3 +785,3 @@ if (content.statuscode) { | ||
if (content.statuscode != 301) { | ||
if (hasResponseHeaders && content.statuscode != 301) { | ||
context.res.setHeader('Cache-Control', 'no-cache, no-store'); | ||
@@ -785,0 +788,0 @@ context.res.setHeader('Expires', 'Mon, 01 Jan 1990 00:00:00 GMT'); |
@@ -768,6 +768,7 @@ (function (global, factory) { | ||
if (content.redirect) { | ||
//match casing of nodeProxyRedirectCasing in mura.js | ||
var hasResponseHeaders = typeof context.res.getHeaders != 'undefined'; //match casing of nodeProxyRedirectCasing in mura.js | ||
//Don't set status code is cookies are coming. 30X will cause them to be ignored | ||
//The browser will handle the redirect | ||
var hasSetCookie = Object.keys(context.res.getHeaders()).findIndex(function (key) { | ||
var hasSetCookie = hasResponseHeaders && Object.keys(context.res.getHeaders()).findIndex(function (key) { | ||
return key.toLowerCase() == 'set-cookie'; | ||
@@ -777,3 +778,5 @@ }) > -1; | ||
if (!hasSetCookie) { | ||
context.res.setHeader('Location', content.redirect); | ||
if (hasResponseHeaders) { | ||
context.res.setHeader('Location', content.redirect); | ||
} | ||
@@ -787,3 +790,3 @@ if (content.statuscode) { | ||
if (content.statuscode != 301) { | ||
if (hasResponseHeaders && content.statuscode != 301) { | ||
context.res.setHeader('Cache-Control', 'no-cache, no-store'); | ||
@@ -790,0 +793,0 @@ context.res.setHeader('Expires', 'Mon, 01 Jan 1990 00:00:00 GMT'); |
{ | ||
"name": "@murasoftware/next-core", | ||
"version": "2.0.14", | ||
"version": "2.0.15", | ||
"description": "Core utilties for Mura.js and Next.js", | ||
@@ -5,0 +5,0 @@ "author": "Mura Software", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
422695
3812
11