Skip to content
Myr

req.acceptedEncodings.js

This file

Path

test/req.acceptedEncodings.js

37 lines · 878 bytes · JavaScript

Last changed by

Not known.

History of this file

Take it

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

Fix req.protocol for proxy-direct connectionsAshley Strebbefore adoptiona28b7a8

lines 1–37why, one step back
1
2var express = require('../')3 , request = require('supertest');45describe('req', function(){6 describe('.acceptedEncodings', function(){7 it('should return an array of accepted encodings', function(done){8 var app = express();910 app.use(function(req, res){11 req.acceptedEncodings.should.eql(['gzip', 'deflate']);12 res.end();13 });1415 request(app)16 .get('/')17 .set('Accept-Encoding', ' gzip, deflate')18 .expect(200, done);19 })2021 describe('when Accept-Encoding is not present', function(){22 it('should default to []', function(done){23 var app = express();2425 app.use(function(req, res){26 req.acceptedEncodings.should.have.length(0);27 res.end();28 });2930 request(app)31 .get('/')32 .set('Accept-Encoding', '')33 .expect(200, done);34 })35 })36 })37})