Skip to content
Myr

Redo cookies parsing to accept quoted values and url escaped cookies

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

authored by Brian McKinney · committed by Brian McKinney · parent ffb23d9 · Browse files · 2 files+21 added−7 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+21 added−7 removed

  • tests:+6 added−1 removed
  • other:+15 added−6 removed

2 files+21 added−7 removed

modified:lib/express/plugins/cookie.js+15 added-6 removed
modified:spec/spec.plugins.cookie.js+6 added-1 removed
53 unmodified lines
54 it 'should disregard ad-hoc invalid whitespace'55 var attrs = ' SID = 1232431234234 ; data = foo'56 parseCookie(attrs).should.eql { SID: '1232431234234', data: 'foo' }57 end5859 it 'should support complex quoted values'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 end64 65 describe 'on'66 describe 'request'
34 unmodified lines
101 end102 end103 104 end100end105end