Skip to content

Commit f1d18ed

Browse files
authored
Test content-length and content-type headers
Test for #15
1 parent b4612a5 commit f1d18ed

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/mocha/integration/echo.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,18 @@ describe('echo Server', function setup() {
194194

195195
it('should answer with correct request header names', function checkResponse(done) {
196196
var hdr1 = 'test1',
197-
hdr2 = 'test2';
197+
hdr2 = 'test2',
198+
cl = '23',
199+
ct = 'text/plain';
198200

199201
request({
200202
uri: 'http://localhost:' + port,
201203
method: 'GET',
202204
headers: {
203-
'x_testhdr': hdr1, // XXX: Using underscores because fcgi-handler
204-
'x_test_hdr': hdr2 // passes hyphens in CGI params
205+
'x_testhdr': hdr1, // XXX: Using underscores because fcgi-handler
206+
'x_test_hdr': hdr2, // passes hyphens in CGI params
207+
'content-length': cl,
208+
'content-type': 'text/plain'
205209
}
206210
}, function (err, res, body) {
207211
expect(res.statusCode).to.be.equal(200);
@@ -210,6 +214,8 @@ describe('echo Server', function setup() {
210214
var echo = JSON.parse(body);
211215
expect(echo).to.have.deep.property('headers.x-testhdr', hdr1);
212216
expect(echo).to.have.deep.property('headers.x-test-hdr', hdr2);
217+
expect(echo).to.have.deep.property('headers.content-length', cl);
218+
expect(echo).to.have.deep.property('headers.content-type', ct);
213219

214220
done(err);
215221
});

0 commit comments

Comments
 (0)