From 5a73a73c36b820c80817fc5b0924a58345f6a0d9 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Mon, 2 Sep 2024 23:28:40 +0200 Subject: [PATCH] Fix installer setting bad controller_url The host.controller_url config is required to end with a / for the url joining logic to work. Fix code added #619 setting this to a value not ending with a /. --- packages/create/create.js | 2 +- test/integration/create.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create/create.js b/packages/create/create.js index 037c31c8..7a2291e2 100755 --- a/packages/create/create.js +++ b/packages/create/create.js @@ -904,7 +904,7 @@ async function main() { let hostToken = result.stdout.split("\n").slice(-2)[0]; // Default to localhost on correct port for host in standalone mode - await execHost(["config", "set", "host.controller_url", `http://localhost:${answers.httpPort}`]); + await execHost(["config", "set", "host.controller_url", `http://localhost:${answers.httpPort}/`]); await execHost(["config", "set", "host.controller_token", hostToken]); await execHost(["config", "set", "host.public_address", answers.publicAddress]); await execHost(["config", "set", "host.factorio_directory", answers.factorioDir]); diff --git a/test/integration/create.js b/test/integration/create.js index 164e8d48..fc6a7535 100644 --- a/test/integration/create.js +++ b/test/integration/create.js @@ -45,7 +45,7 @@ describe("Integration of create tool", function () { assert.equal(hostConfig["host.name"], "local"); assert.equal(hostConfig["host.public_address"], "localhost"); assert.equal(hostConfig["host.factorio_directory"], "test/factorio"); - assert.equal(hostConfig["host.controller_url"], "http://localhost:8099"); + assert.equal(hostConfig["host.controller_url"], "http://localhost:8099/"); }).timeout(1200000); it("should create a new controller installation", async function () { this.skip();