@@ -36,7 +36,7 @@ Inject = {
36
36
if ( res )
37
37
this . resPush ( res , 'rawBodies' , id , textOrFunc ) ;
38
38
else
39
- this . rawBodies [ id ] = text ;
39
+ this . rawBodies [ id ] = textOrFunc ;
40
40
} ,
41
41
rawBodies : { } ,
42
42
@@ -60,7 +60,7 @@ Inject = {
60
60
for ( id in objs ) {
61
61
obj = _ . isFunction ( objs [ id ] ) ? objs [ id ] ( res ) : objs [ id ] ;
62
62
injectHtml += " <script id='" + id . replace ( "'" , ''' )
63
- + "' type='application/ejson'>" + EJSON . stringify ( obj )
63
+ + "' type='application/ejson'>" + EJSON . stringify ( obj )
64
64
+ "</script>\n" ;
65
65
}
66
66
@@ -89,7 +89,7 @@ Inject = {
89
89
90
90
var injectHtml = '' ;
91
91
for ( id in heads )
92
- injectHtml = ' ' + heads [ id ] + '\n' ;
92
+ injectHtml + = ' ' + heads [ id ] + '\n' ;
93
93
94
94
return html . replace ( '<head>' , '<head>\n' + injectHtml ) ;
95
95
} ,
@@ -100,7 +100,7 @@ Inject = {
100
100
101
101
var injectHtml = '' ;
102
102
for ( id in bodies )
103
- injectHtml = ' ' + bodies [ id ] + '\n' ;
103
+ injectHtml + = ' ' + bodies [ id ] + '\n' ;
104
104
105
105
return html . replace ( '<body>' , '<body>\n' + injectHtml ) ;
106
106
} ,
@@ -136,7 +136,7 @@ var http = Npm.require('http');
136
136
var originalWrite = http . OutgoingMessage . prototype . write ;
137
137
http . OutgoingMessage . prototype . write = function ( chunk , encoding ) {
138
138
//prevent hijacking other http requests
139
- if ( ! this . iInjected &&
139
+ if ( ! this . iInjected &&
140
140
encoding === undefined && / ^ < ! D O C T Y P E h t m l > / . test ( chunk ) ) {
141
141
142
142
chunk = chunk . toString ( ) ;
0 commit comments