File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,8 @@ koa.use(async (context, next) => {
327
327
// Inject host, port, and official
328
328
src = `${ src . substring ( 0 , i ) } ,
329
329
host: ${ JSON . stringify ( backend . hostname ) } ,
330
- port: ${ backend . port || '80' } ,
330
+ protocol: "${ backend . protocol } ",
331
+ port: ${ backend . port || ( backend . protocol === 'https:' ? '443' : '80' ) } ,
331
332
official: ${ isOfficialLike } ,
332
333
} ${ src . substring ( i + 1 ) } ` ;
333
334
}
@@ -348,7 +349,10 @@ koa.use(async (context, next) => {
348
349
}
349
350
350
351
// Replace URLs with local client paths
351
- src = src . replace ( / h t t p s : \/ \/ s c r e e p s .c o m \/ a \/ / g, client . getURL ( Route . ROOT ) ) ;
352
+ src = src . replace ( / h t t p s : \/ \/ s c r e e p s \. c o m \/ a \/ / g, client . getURL ( Route . ROOT ) ) ;
353
+
354
+ // Fix the hardcoded protocol in URLs
355
+ src = src . replace ( / " h t t p : \/ \/ " \+ ( [ ^ \. ] + ) \. o p t i o n s \. h o s t / g, '$1.options.protocol+"//"+$1.options.host' ) ;
352
356
}
353
357
return argv . beautify ? jsBeautify ( src ) : src ;
354
358
} else if ( urlPath === 'components/profile/profile.html' ) {
You can’t perform that action at this time.
0 commit comments