Skip to content

Commit 4a80385

Browse files
committed
Update replayFallbackUrl() logic for improved URL construction
1 parent 8e1a1af commit 4a80385

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/core/configuration/DefaultConfig.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ export abstract class DefaultServerConfig implements ServerConfig {
206206
return 3001 + index;
207207
}
208208
replayFallbackUrl(gameId: GameID): string {
209-
return `https://api.openfront.io/game/${gameId}`;
209+
const url = new URL(this.jwtIssuer());
210+
url.pathname = `/game/${gameId}`;
211+
return url.toString();
210212
}
211213
}
212214

src/core/configuration/DevConfig.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { UnitInfo, UnitType } from "../game/Game";
22
import { UserSettings } from "../game/UserSettings";
3-
import { GameConfig } from "../Schemas";
3+
import { GameConfig, GameID } from "../Schemas";
44
import { GameEnv, ServerConfig } from "./Config";
55
import { DefaultConfig, DefaultServerConfig } from "./DefaultConfig";
66

@@ -42,6 +42,10 @@ export class DevServerConfig extends DefaultServerConfig {
4242
subdomain(): string {
4343
return "";
4444
}
45+
46+
replayFallbackUrl(gameId: GameID): string {
47+
return `https://api.openfront.io/game/${gameId}`;
48+
}
4549
}
4650

4751
export class DevConfig extends DefaultConfig {

0 commit comments

Comments
 (0)