mirror of
https://github.com/coder/code-server.git
synced 2026-05-16 06:55:13 -05:00
Proxy path fixes (#4548)
* Fix issue where HTTP error status codes are not read. * Fix issues surrounding sessions when accessed from a proxy. - Updated vscode args to match latest upstream. - Fixed issues surrounding trailing slashes affecting base paths. - Updated cookie names to better match upstream's usage, debuggability. * Bump vendor. * Update tests. * Fix issue where tests lack cookie key. Co-authored-by: Asher <ash@coder.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import * as net from "net"
|
||||
import path from "path"
|
||||
import qs from "qs"
|
||||
import { Disposable } from "../common/emitter"
|
||||
import { HttpCode, HttpError } from "../common/http"
|
||||
import { CookieKeys, HttpCode, HttpError } from "../common/http"
|
||||
import { normalize } from "../common/util"
|
||||
import { AuthType, DefaultedArgs } from "./cli"
|
||||
import { version as codeServerVersion } from "./constants"
|
||||
@@ -93,7 +93,7 @@ export const authenticated = async (req: express.Request): Promise<boolean> => {
|
||||
const passwordMethod = getPasswordMethod(hashedPasswordFromArgs)
|
||||
const isCookieValidArgs: IsCookieValidArgs = {
|
||||
passwordMethod,
|
||||
cookieKey: sanitizeString(req.cookies.key),
|
||||
cookieKey: sanitizeString(req.cookies[CookieKeys.Session]),
|
||||
passwordFromArgs: req.args.password || "",
|
||||
hashedPasswordFromArgs: req.args["hashed-password"],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user