diff --git a/packages/gluestick/shared/lib/getHttpClient.js b/packages/gluestick/shared/lib/getHttpClient.js index d53a10021..ce63a2762 100644 --- a/packages/gluestick/shared/lib/getHttpClient.js +++ b/packages/gluestick/shared/lib/getHttpClient.js @@ -83,9 +83,17 @@ export default function getHttpClient( // not in gsBeforeRoute for apps where that is an issue. const mergedCookieString: string = merge(incomingCookies, cookieString); const cookies: Object[] = parse(mergedCookieString); - res.removeHeader('Set-Cookie'); + try { + res.removeHeader('Set-Cookie'); + } catch (e) { + console.error(e.message ? e.message : e); + } cookies.forEach((cookie: Object) => { - res.append('Set-Cookie', cookie.toString()); + try { + res.append('Set-Cookie', cookie.toString()); + } catch (e){ + console.error(e.message ? e.message : e, cookie.name); + } }); // Ensure that any subsequent requests are passing the cookies.