Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dcfdd03

Browse files
authored
Awaterma issue#144 property secure (#181)
* Added unit test for issue 144; passing in master. * Updated test to use async call and handle results correctly. Updated Dockerfile to use LTR Node v.12
1 parent b75fd59 commit dcfdd03

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node
1+
FROM node:12
22
33
LABEL Description="Vendor=\"Salesforce.com\" Version=\"1.0\""
44
RUN apt-get update && \

test/cookie_jar_test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,4 +644,29 @@ vows
644644
}
645645
}
646646
})
647+
.addBatch({
648+
"Issue #144 - secure": {
649+
"of undefined": {
650+
topic: function() {
651+
const jar = new tough.CookieJar();
652+
const cookieString = `AWSELB=69b2c0038b16e8e27056d1178e0d556c;
653+
Path=/, jses_WS41=5f8dc2f6-ea37-49de-8dfa-b58336c2d9ce; path=/;
654+
Secure; HttpOnly, AuthToken=EFKFFFCH@K@GHIHEJCJMMGJM>CDHDEK>CFGK?MHJ
655+
>>JI@B??@CAEHBJH@H@A@GCFDLIMLJEEJEIFGALA?BIM?@G@DEDI@JE?I?HKJBIDDHJMEFEFM
656+
>G@J?I??B@C>>LAH?GCGJ@FMEGHBGAF; expires=Sun, 31-Jan-9021 02:39:04 GMT;
657+
path=/; Secure; HttpOnly, FirstReferrer=; expires=Fri, 31-Jan-9020 20:50:44
658+
GMT; path=/`;
659+
660+
jar.setCookieSync(cookieString, "https://google.com");
661+
jar.getCookies("https://google.com", this.callback)
662+
},
663+
"results in a 1-length array with a valid cookie": function(err, cookies) {
664+
assert(!err, err);
665+
assert(cookies.length == 1);
666+
assert.instanceOf(cookies[0], Cookie);
667+
assert.isTrue(cookies[0].secure);
668+
}
669+
}
670+
}
671+
})
647672
.export(module);

0 commit comments

Comments
 (0)