diff --git a/src/node/http.ts b/src/node/http.ts index e0fb3a4ca..6500dc87f 100644 --- a/src/node/http.ts +++ b/src/node/http.ts @@ -1,9 +1,8 @@ import { field, logger } from "@coder/logger" import * as express from "express" -import * as expressCore from "express-serve-static-core" import * as http from "http" import * as net from "net" -import * as qs from "qs" +import qs from "qs" import { Disposable } from "../common/emitter" import { CookieKeys, HttpCode, HttpError } from "../common/http" import { normalize } from "../common/util" @@ -185,12 +184,7 @@ export const constructRedirectPath = (req: express.Request, query: qs.ParsedQs, * preserved. `to` should be a simple path without any query parameters * `override` will merge with the existing query (use `undefined` to unset). */ -export const redirect = ( - req: express.Request, - res: express.Response, - to: string, - override: expressCore.Query = {}, -): void => { +export const redirect = (req: express.Request, res: express.Response, to: string, override: qs.ParsedQs = {}): void => { const query = Object.assign({}, req.query, override) Object.keys(override).forEach((key) => { if (typeof override[key] === "undefined") { diff --git a/src/node/settings.ts b/src/node/settings.ts index 29716af03..cc55dd5f9 100644 --- a/src/node/settings.ts +++ b/src/node/settings.ts @@ -1,5 +1,5 @@ import { logger } from "@coder/logger" -import { Query } from "express-serve-static-core" +import type { ParsedQs } from "qs" import { promises as fs } from "fs" export type Settings = { [key: string]: Settings | string | boolean | number } @@ -52,5 +52,5 @@ export interface UpdateSettings { * Global code-server settings. */ export interface CoderSettings extends UpdateSettings { - query?: Query + query?: ParsedQs }