Skip to content
Myr

req.signedCookies.js

This file

Path

test/req.signedCookies.js

39 lines · 910 bytes · JavaScript

Last changed by

remove second signed cookie testTJ Holowaychukbefore adoptionab8be2d

History of this file

Take it

The walk stopped after 200 commits: lines older than dd338b5 point at it.

Merge pull request #1309 from nickjj/patch-1TJ Holowaychukbefore adoptiondd338b5

lines 1–7why, one step back
1
2var express = require('../')3 , request = require('./support/http');45describe('req', function(){6 describe('.signedCookies', function(){7 it('should return a signed JSON cookie', function(done){

refactor signed cookie testsTJ Holowaychukbefore adoption9fb6615

line 8why, one step back
8 var app = express();

Merge pull request #1309 from nickjj/patch-1TJ Holowaychukbefore adoptiondd338b5

lines 9–12why, one step back
9
10 app.use(express.cookieParser('secret'));1112 app.use(function(req, res){

fix signed cookies testTJ Holowaychukbefore adoption3b53b11

lines 13–18why, one step back
13 if ('/set' == req.path) {
14 res.cookie('obj', { foo: 'bar' }, { signed: true });15 res.end();16 } else {17 res.send(req.signedCookies);18 }

Merge pull request #1309 from nickjj/patch-1TJ Holowaychukbefore adoptiondd338b5

lines 19–21why, one step back
19 });
2021 request(app)

fix signed cookies testTJ Holowaychukbefore adoption3b53b11

lines 22–35why, one step back
22 .get('/set')
23 .end(function(err, res){24 if (err) return done(err);25 var cookie = res.header['set-cookie'];2627 request(app)28 .get('/')29 .set('Cookie', cookie)30 .end(function(err, res){31 if (err) return don(err);32 res.body.should.eql({ obj: { foo: 'bar' } });33 done();34 });35 });

Merge pull request #1309 from nickjj/patch-1TJ Holowaychukbefore adoptiondd338b5

lines 36–39why, one step back
36 })
37 })38})39