mirror of
https://github.com/coder/code-server.git
synced 2026-05-28 17:43:51 +02:00
fixup: use REVERSE_PROXY_BASE_PATH
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { describe, test, expect } from "./baseFixture"
|
import { describe, test, expect } from "./baseFixture"
|
||||||
import { clean } from "../utils/helpers"
|
import { clean } from "../utils/helpers"
|
||||||
|
import { REVERSE_PROXY_BASE_PATH } from "../utils/constants"
|
||||||
|
|
||||||
const routes = ["/", "/vscode", "/vscode/"]
|
const routes = ["/", "/vscode", "/vscode/"]
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
|||||||
const url = new URL(codeServerPage.page.url())
|
const url = new URL(codeServerPage.page.url())
|
||||||
if (process.env.USE_PROXY === "1") {
|
if (process.env.USE_PROXY === "1") {
|
||||||
// Behind proxy, path will be /<port/ide + route
|
// Behind proxy, path will be /<port/ide + route
|
||||||
const pathWithoutProxy = url.pathname.split("/ide")[1]
|
const pathWithoutProxy = url.pathname.split(`/${REVERSE_PROXY_BASE_PATH}`)[1]
|
||||||
expect(pathWithoutProxy).toBe(route)
|
expect(pathWithoutProxy).toBe(route)
|
||||||
} else {
|
} else {
|
||||||
expect(url.pathname).toBe(route)
|
expect(url.pathname).toBe(route)
|
||||||
|
|||||||
Reference in New Issue
Block a user