/
githubmirror
/
code-server
Обзор
Документация
Войти
/
githubmirror
/
code-server
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v4.131.0
src/common/http.ts
29 строк
700 B
Timon Fiedler
Add cookie-suffix flag (#7590)
12 дек 2025, 04:23
Не верифицирован
12 дек 2025, 04:23
68ac95b
Код
Авторство
О чём код?
export enum HttpCode { Ok = 200, Redirect = 302, NotFound = 404, BadRequest = 400, Unauthorized = 401, Forbidden = 403, LargePayload = 413, ServerError = 500, } /** * Represents an error with a message and an HTTP status code. This code will be * used in the HTTP response. */ export class HttpError extends Error { public constructor( message: string, public readonly statusCode: HttpCode, public readonly details?: object, ) { super(message) this.name = this.constructor.name } } export function getCookieSessionName(suffix?: string): string { return suffix ? `code-server-session-${suffix.replace(/[^a-zA-Z0-9-]/g, "-")}` : "code-server-session" }