File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ function noopResolves () {
1717
1818function sendSuccess ( res , info ) {
1919 res . statusCode = 200
20+ res . setHeader ( 'Content-Type' , 'application/json' )
2021 if ( info ) {
2122 return res . end ( JSON . stringify ( {
2223 status : 'ok' ,
@@ -28,6 +29,7 @@ function sendSuccess (res, info) {
2829
2930function sendFailure ( res ) {
3031 res . statusCode = 503
32+ res . setHeader ( 'Content-Type' , 'application/json' )
3133 res . end ( FAILURE_RESPONSE )
3234}
3335
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ describe('Terminus', () => {
4848 fetch ( 'http://localhost:8000/health' )
4949 . then ( res => {
5050 expect ( res . status ) . to . eql ( 200 )
51+ expect ( res . headers . has ( 'Content-Type' ) ) . to . eql ( true )
52+ expect ( res . headers . get ( 'Content-Type' ) ) . to . eql ( 'application/json' )
5153 expect ( onHealthCheckRan ) . to . eql ( true )
5254 done ( )
5355 } )
@@ -72,6 +74,8 @@ describe('Terminus', () => {
7274 fetch ( 'http://localhost:8000/health' )
7375 . then ( res => {
7476 expect ( res . status ) . to . eql ( 200 )
77+ expect ( res . headers . has ( 'Content-Type' ) ) . to . eql ( true )
78+ expect ( res . headers . get ( 'Content-Type' ) ) . to . eql ( 'application/json' )
7579 expect ( onHealthCheckRan ) . to . eql ( true )
7680 return res . json ( )
7781 } )
You can’t perform that action at this time.
0 commit comments