req.signedCookies.js
This file
Path
test/req.signedCookies.js
37 lines · 851 bytes · JavaScript
Last changed by
Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
History of this fileTake it
The walk stopped after 200 commits: lines older than 2a0c35a point at it.
Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
line 1why, one step back1'use strict'Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a
lines 2–14why, one step back23var express = require('../')4 , request = require('supertest')5 , cookieParser = require('cookie-parser')67describe('req', function(){8 describe('.signedCookies', function(){9 it('should return a signed JSON cookie', function(done){10 var app = express();1112 app.use(cookieParser('secret'));1314 app.use(function(req, res){Merge tag '4.16.4'Douglas Christopher Wilsonbefore adoption302a615
line 15why, one step back15 if (req.path === '/set') {Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a
lines 16–31why, one step back16 res.cookie('obj', { foo: 'bar' }, { signed: true });17 res.end();18 } else {19 res.send(req.signedCookies);20 }21 });2223 request(app)24 .get('/set')25 .end(function(err, res){26 if (err) return done(err);27 var cookie = res.header['set-cookie'];2829 request(app)30 .get('/')31 .set('Cookie', cookie)Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c
line 32why, one step back32 .expect(200, { obj: { foo: 'bar' } }, done)Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a
lines 33–37why, one step back33 });34 })35 })36})37