Skip invalid cookies and some tweaks

This commit is contained in:
Gregory Schier 2017-05-25 08:01:45 -07:00
parent eef584528a
commit 4537582c78
3 changed files with 11 additions and 6 deletions

View File

@ -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)) {
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}`;
}
}

View File

@ -250,7 +250,7 @@ class RequestSwitcherModal extends PureComponent {
<div className="pull-right faint italic">
{requestGroup.name}
&nbsp;&nbsp;
<i className="fa fa-folder-o"></i>
<i className="fa fa-folder-o"/>
</div>
)}
<MethodTag method={r.method}/>
@ -260,10 +260,10 @@ class RequestSwitcherModal extends PureComponent {
);
})}
{matchedRequests.length && matchedWorkspaces.length && (
<div className="pad-left pad-right">
{(matchedRequests.length > 0 && matchedWorkspaces.length > 0) && (
<li className="pad-left pad-right">
<hr/>
</div>
</li>
)}
{matchedWorkspaces.map((w, i) => {

View File

@ -79,6 +79,7 @@
}
.modal__header {
overflow: hidden;
border-bottom: 1px solid @hl-md;
height: @line-height-md;
font-size: @font-size-lg;