Skip to content
Myr

req.acceptsEncodings.js

This file

Path

test/req.acceptsEncodings.js

39 lines · 953 bytes · JavaScript

Last changed by

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

History of this file

Take 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 back
1'use strict'

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 2–6why, one step back
2
3var express = require('../')4 , request = require('supertest');56describe('req', function(){

Merge tag '4.17.1'Douglas Christopher Wilsonbefore adoption121fe99

line 7why, one step back
7 describe('.acceptsEncodings', function () {

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 8why, one step back
8 it('should return encoding if accepted', function (done) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 9–10why, one step back
9 var app = express();
10

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 11–16why, one step back
11 app.get('/', function (req, res) {
12 res.send({13 gzip: req.acceptsEncodings('gzip'),14 deflate: req.acceptsEncodings('deflate')15 })16 })

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 17–18why, one step back
17
18 request(app)

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 19–21why, one step back
19 .get('/')
20 .set('Accept-Encoding', ' gzip, deflate')21 .expect(200, { gzip: 'gzip', deflate: 'deflate' }, done)

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 22–23why, one step back
22 })
23

Merge tag '4.14.1'Douglas Christopher Wilsonbefore adoptionbcbb9d5

line 24why, one step back
24 it('should be false if encoding not accepted', function(done){

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 25–26why, one step back
25 var app = express();
26

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 27–31why, one step back
27 app.get('/', function (req, res) {
28 res.send({29 bogus: req.acceptsEncodings('bogus')30 })31 })

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 32–33why, one step back
32
33 request(app)

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 34–36why, one step back
34 .get('/')
35 .set('Accept-Encoding', ' gzip, deflate')36 .expect(200, { bogus: false }, done)

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

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