File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11module . exports = {
22 modes : {
3- 'info' : ( definition , params ) => Buffer . from ( `Initiated ${ definition . name } ...` ) ,
3+ 'info' : ( definition , params ) => Buffer . from ( `Initiated " ${ definition . name } " ...` ) ,
44 'empty' : ( definition , params ) => Buffer . from ( [ ] ) ,
55 'params' : ( definition , params ) => {
66 let specifiedBgParams = definition . background . value
Original file line number Diff line number Diff line change @@ -164,8 +164,9 @@ class Gateway extends EventEmitter {
164164 let value = bgResponse ( definition , params ) ;
165165 headers = headers || { } ;
166166 headers = this . __createHeaders__ ( req , headers ) ;
167- headers [ 'content-type' ] = headers [ 'content-type' ] ||
168- ( value instanceof Buffer ? 'application/octet-stream' : 'application/json' ) ;
167+ headers [ 'content-type' ] = value instanceof Buffer
168+ ? 'text/plain'
169+ : 'application/json' ;
169170 value = value instanceof Buffer ? value : JSON . stringify ( value ) ;
170171 res . headersSent || res . writeHead ( 202 , this . __formatHeaders__ ( headers ) ) ;
171172 res . finished || res . end ( value ) ;
Original file line number Diff line number Diff line change @@ -1174,6 +1174,7 @@ module.exports = (expect) => {
11741174 expect ( result ) . to . exist ;
11751175 expect ( result ) . to . be . instanceof ( Buffer ) ;
11761176 expect ( result . length ) . to . be . greaterThan ( 0 ) ;
1177+ expect ( result . toString ( ) ) . to . equal ( `Initiated "bg"...` ) ;
11771178 done ( ) ;
11781179
11791180 } ) ;
You can’t perform that action at this time.
0 commit comments