fix(react): mf should consider ssl when setting remote urls #16989 (#17746)

This commit is contained in:
Colum Ferry 2023-06-23 14:15:32 +01:00 committed by GitHub
parent 61faa558bb
commit 1891addc09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -58,7 +58,9 @@ export function getFunctionDeterminateRemoteUrl(isServer: boolean = false) {
); );
} }
const host = serveTarget.options?.host ?? 'http://localhost'; const host =
serveTarget.options?.host ??
`http${serveTarget.options.ssl ? 's' : ''}://localhost`;
const port = serveTarget.options?.port ?? 4201; const port = serveTarget.options?.port ?? 4201;
return `${ return `${
host.endsWith('/') ? host.slice(0, -1) : host host.endsWith('/') ? host.slice(0, -1) : host

View File

@ -31,7 +31,9 @@ export function getFunctionDeterminateRemoteUrl(isServer: boolean = false) {
); );
} }
const host = serveTarget.options?.host ?? 'http://localhost'; const host =
serveTarget.options?.host ??
`http${serveTarget.options.ssl ? 's' : ''}://localhost`;
const port = serveTarget.options?.port ?? 4201; const port = serveTarget.options?.port ?? 4201;
return `${ return `${
host.endsWith('/') ? host.slice(0, -1) : host host.endsWith('/') ? host.slice(0, -1) : host