File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ class CoCreateFileSystem {
145145 }
146146
147147 let contentType = file [ 'content-type' ] || 'text/html' ;
148- // const cleanedSrc = src.replace(/\s/g, '');
148+
149149 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 ) ) {
150150 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 , / , '' ) ;
151151 src = Buffer . from ( src , 'base64' ) ;
@@ -155,8 +155,11 @@ class CoCreateFileSystem {
155155 try {
156156 src = await this . render . HTML ( src , organization_id ) ;
157157 } catch ( err ) {
158- console . warn ( 'server-render: ' + err . message )
158+ console . warn ( 'server-side- render: ' + err . message )
159159 }
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 } ` )
160163 }
161164
162165 sendResponse ( src , 200 , { 'Content-Type' : contentType } )
You can’t perform that action at this time.
0 commit comments