File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ class CoCreateFileSystem {
145
145
}
146
146
147
147
let contentType = file [ 'content-type' ] || 'text/html' ;
148
- // const cleanedSrc = src.replace(/\s/g, '');
148
+
149
149
if ( / ^ d a t a : i m a g e \/ [ a - z A - Z 0 - 9 + . - ] + ; b a s e 6 4 , ( [ A - Z a - z 0 - 9 + / ] + = { 0 , 2 } ) $ / . test ( src ) ) {
150
150
src = src . replace ( / ^ d a t a : i m a g e \/ ( p n g | j p e g | j p g ) ; b a s e 6 4 , / , '' ) ;
151
151
src = Buffer . from ( src , 'base64' ) ;
@@ -155,8 +155,11 @@ class CoCreateFileSystem {
155
155
try {
156
156
src = await this . render . HTML ( src , organization_id ) ;
157
157
} catch ( err ) {
158
- console . warn ( 'server-render: ' + err . message )
158
+ console . warn ( 'server-side- render: ' + err . message )
159
159
}
160
+ } else if ( contentType === 'text/xml' || contentType === 'application/xml' ) {
161
+ const protocol = 'https://' // || req.headers['x-forwarded-proto'] || req.protocol;
162
+ src = src . replaceAll ( '{{$host}}' , `${ protocol } ${ hostname } ` )
160
163
}
161
164
162
165
sendResponse ( src , 200 , { 'Content-Type' : contentType } )
You can’t perform that action at this time.
0 commit comments