Add --abs-proxy-base-path for when code-server is not at the root (#6958)

This commit is contained in:
Rafael Ferreira
2024-08-26 21:19:55 +01:00
committed by GitHub
parent 39ce82a44d
commit 4a703893b0
6 changed files with 43 additions and 4 deletions

View File

@ -256,6 +256,18 @@ describe("proxy", () => {
expect(spy).toHaveBeenCalledWith([test.expected, test.query])
}
})
it("should allow specifying an absproxy path", async () => {
const prefixedPath = `/codeserver/app1${absProxyPath}`
e.get(prefixedPath, (req, res) => {
res.send("app being served behind a prefixed path")
})
codeServer = await integration.setup(["--auth=none", "--abs-proxy-base-path=/codeserver/app1"], "")
const resp = await codeServer.fetch(absProxyPath)
expect(resp.status).toBe(200)
const text = await resp.text()
expect(text).toBe("app being served behind a prefixed path")
})
})
// NOTE@jsjoeio