From 4537582c7843d81f103c9a34295944bebc53a194 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 25 May 2017 08:01:45 -0700 Subject: [PATCH] Skip invalid cookies and some tweaks --- app/network/network.js | 8 ++++++-- app/ui/components/modals/request-switcher-modal.js | 8 ++++---- app/ui/css/components/modal.less | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/network/network.js b/app/network/network.js index 110bd291c..59b880077 100644 --- a/app/network/network.js +++ b/app/network/network.js @@ -415,14 +415,18 @@ export function _actuallySend (renderedRequest, workspace, settings) { if (renderedRequest.settingStoreCookies && setCookieHeaders.length) { const jar = jarFromCookies(renderedRequest.cookieJar.cookies); for (const header of getSetCookieHeaders(headers)) { - jar.setCookieSync(header.value, curl.getInfo(Curl.info.EFFECTIVE_URL)); + try { + jar.setCookieSync(header.value, curl.getInfo(Curl.info.EFFECTIVE_URL)); + } catch (err) { + timeline.push({name: 'TEXT', value: `Rejected cookie: ${err.message}`}); + } } const cookies = await cookiesFromJar(jar); // Make sure domains are prefixed with dots (Curl does this) for (const cookie of cookies) { - if (cookie.domain[0] !== '.') { + if (cookie.domain && cookie.domain[0] !== '.') { cookie.domain = `.${cookie.domain}`; } } diff --git a/app/ui/components/modals/request-switcher-modal.js b/app/ui/components/modals/request-switcher-modal.js index 46f1919ee..903b79078 100644 --- a/app/ui/components/modals/request-switcher-modal.js +++ b/app/ui/components/modals/request-switcher-modal.js @@ -250,7 +250,7 @@ class RequestSwitcherModal extends PureComponent {
{requestGroup.name}    - +
)} @@ -260,10 +260,10 @@ class RequestSwitcherModal extends PureComponent { ); })} - {matchedRequests.length && matchedWorkspaces.length && ( -
+ {(matchedRequests.length > 0 && matchedWorkspaces.length > 0) && ( +

  • -
  • + )} {matchedWorkspaces.map((w, i) => { diff --git a/app/ui/css/components/modal.less b/app/ui/css/components/modal.less index 4013be22c..14529d8a1 100644 --- a/app/ui/css/components/modal.less +++ b/app/ui/css/components/modal.less @@ -79,6 +79,7 @@ } .modal__header { + overflow: hidden; border-bottom: 1px solid @hl-md; height: @line-height-md; font-size: @font-size-lg;