mirror of
https://github.com/coder/code-server.git
synced 2025-09-18 18:57:50 +08:00
Add --abs-proxy-base-path for when code-server is not at the root (#6958)
This commit is contained in:
@ -106,6 +106,8 @@ describe("parser", () => {
|
||||
|
||||
"--disable-proxy",
|
||||
|
||||
["--abs-proxy-base-path", "/codeserver/app1"],
|
||||
|
||||
["--session-socket", "/tmp/override-code-server-ipc-socket"],
|
||||
|
||||
["--host", "0.0.0.0"],
|
||||
@ -143,6 +145,7 @@ describe("parser", () => {
|
||||
version: true,
|
||||
"bind-addr": "192.169.0.1:8080",
|
||||
"session-socket": "/tmp/override-code-server-ipc-socket",
|
||||
"abs-proxy-base-path": "/codeserver/app1",
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user