File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -177,8 +177,12 @@ export class BehaviorRouter {
177
177
res . setHeader ( key as string , value ) ;
178
178
}
179
179
}
180
-
181
- res . end ( response . body ) ;
180
+
181
+ if ( response . bodyEncoding === 'base64' ) {
182
+ res . end ( Buffer . from ( response . body , 'base64' ) . toString ( 'utf-8' ) ) ;
183
+ } else {
184
+ res . end ( response . body ) ;
185
+ }
182
186
} catch ( err ) {
183
187
this . handleError ( err , res ) ;
184
188
return ;
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ export class Origin {
123
123
method : request . method ,
124
124
protocol : baseUrl . protocol ,
125
125
hostname : baseUrl . hostname ,
126
- port : baseUrl . port || ( baseUrl . protocol === 'https:' ) ? 443 : 80 ,
126
+ port : baseUrl . port || ( baseUrl . protocol === 'https:' ? 443 : 80 ) ,
127
127
path : uri . path ,
128
128
headers : {
129
129
...headers ,
@@ -144,7 +144,9 @@ export class Origin {
144
144
} ) ;
145
145
res . on ( 'error' , ( err : Error ) => reject ( err ) ) ;
146
146
} ) ;
147
-
147
+ if ( request . body && request . body . data ) {
148
+ req . write ( request . body . data ) ;
149
+ }
148
150
req . end ( ) ;
149
151
} ) ;
150
152
}
You can’t perform that action at this time.
0 commit comments