Skip to content

Commit

Permalink
test: setting correct base url from about lambdas (#6032)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalkia authored Dec 29, 2023
1 parent 0e6ab71 commit 09026c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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){
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){
baseUrl = new URL(realmAdapter.about.lambdas?.publicUrl).hostname
}

return {
realmInfo: {
baseUrl,
Expand Down

0 comments on commit 09026c5

Please sign in to comment.