Skip to content
Myr

req.get.js

This file

Path

test/req.get.js

35 lines · 831 bytes · JavaScript

Last changed by

Not known.

History of this file

Take it

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

Invoke router.param() only when route matchesDouglas Christopher Wilsonbefore adoption269dc53

lines 1–35why, one step back
1
2var express = require('../')3 , request = require('supertest')4 , assert = require('assert');56describe('req', function(){7 describe('.get(field)', function(){8 it('should return the header field value', function(done){9 var app = express();1011 app.use(function(req, res){12 assert(req.get('Something-Else') === undefined);13 res.end(req.get('Content-Type'));14 });1516 request(app)17 .post('/')18 .set('Content-Type', 'application/json')19 .expect('application/json', done);20 })2122 it('should special-case Referer', function(done){23 var app = express();2425 app.use(function(req, res){26 res.end(req.get('Referer'));27 });2829 request(app)30 .post('/')31 .set('Referrer', 'http://foobar.com')32 .expect('http://foobar.com', done);33 })34 })35})