@@ -154,7 +154,7 @@ describe('echo Server', function setup() {
154154 } ) ;
155155
156156 it ( 'should answer with the request querystring' , function checkResponse ( done ) {
157- var requestPath = '/query/somthing ' ;
157+ var requestPath = '/query/something ' ;
158158
159159 request ( {
160160 baseUrl : 'http://localhost:' + port ,
@@ -193,6 +193,29 @@ describe('echo Server', function setup() {
193193 } ) ;
194194 } ) ;
195195
196+ it ( 'should answer with correct request header names' , function checkResponse ( done ) {
197+ var hdr1 = 'test1' ,
198+ hdr2 = 'test2' ;
199+
200+ request ( {
201+ uri : 'http://localhost:' + port ,
202+ method : 'GET' ,
203+ headers : {
204+ 'x_testhdr' : hdr1 , // XXX: Using underscores because fcgi-handler
205+ 'x_test_hdr' : hdr2 // passes hyphens in CGI params
206+ }
207+ } , function ( err , res , body ) {
208+ expect ( res . statusCode ) . to . be . equal ( 200 ) ;
209+ expect ( res . headers [ 'content-type' ] ) . to . be . equal ( 'application/json; charset=utf-8' ) ;
210+
211+ var echo = JSON . parse ( body ) ;
212+ expect ( echo ) . to . have . deep . property ( 'headers.x-testhdr' , hdr1 ) ;
213+ expect ( echo ) . to . have . deep . property ( 'headers.x-test-hdr' , hdr2 ) ;
214+
215+ done ( err ) ;
216+ } ) ;
217+ } ) ;
218+
196219 after ( function removeSocketPath ( done ) {
197220 require ( 'fs' ) . unlink ( socketPath , done ) ;
198221 } ) ;
0 commit comments