Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: setting correct base url from about lambdas #6032

Merged
merged 9 commits into from
Dec 29, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ export function getDecentralandTime() {

export function toEnvironmentRealmType(realm: IRealmAdapter, island: string | undefined): EnvironmentRealm {
const serverName = realmToConnectionString(realm)
const hostname = new URL(realm.baseUrl).hostname
let hostname = new URL(realm.baseUrl).hostname

if(realm.about.configurations?.realmName == 'main' && realm.about.lambdas?.publicUrl !== undefined){
dalkia marked this conversation as resolved.
Show resolved Hide resolved
hostname = new URL(realm.about.lambdas?.publicUrl).hostname
}
return {
protocol: realm.about.comms?.protocol || 'v3',
// domain explicitly expects the URL with the protocol
Expand Down
6 changes: 5 additions & 1 deletion browser-interface/packages/shared/apis/host/Runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ export function registerRuntimeServiceServerImplementation(port: RpcServerPort<P
if (!realmAdapter) {
return {}
}
const baseUrl = urlWithProtocol(new URL(realmAdapter.baseUrl).hostname)
let baseUrl = urlWithProtocol(new URL(realmAdapter.baseUrl).hostname)

if(realmAdapter.about.configurations?.realmName == 'main' && realmAdapter.about.lambdas?.publicUrl !== undefined){
dalkia marked this conversation as resolved.
Show resolved Hide resolved
baseUrl = new URL(realmAdapter.about.lambdas?.publicUrl).hostname
}

return {
realmInfo: {
baseUrl,
Expand Down