Skip to content
Myr

Misc refactoring to make parseCookie() more readable / spec for overriding keys

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent dfc2331 · Browse files · 2 files+14 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−9 removed

  • tests:+5 added−0 removed
  • other:+9 added−9 removed

2 files+14 added−9 removed

modified:lib/express/plugins/cookie.js+9 added-9 removed
modified:spec/spec.plugins.cookie.js+5 added
59 unmodified lines
60 var attrs = 'SID="123456789"; fbs_0011223355="uid=0987654321&name=Test+User"'61 parseCookie(attrs).should.eql { SID: '123456789', fbs_0011223355: 'uid=0987654321&name=Test User' }62 end63 64 it 'should not override when a duplicate key is found'65 var attrs = 'SID=1234; SID=9999'66 parseCookie(attrs).should.eql { SID: '1234' }67 end68 69 it 'should support malformed cookies'70 var attrs = 'SID'71 parseCookie(attrs).should.eql {}72 end
43 unmodified lines