MCPcopy Index your code
hub / github.com/coder/code-server / redirect

Function redirect

src/node/http.ts:188–199  ·  view source on GitHub ↗
(req: express.Request, res: express.Response, to: string, override: qs.ParsedQs = {})

Source from the content-addressed store, hash-verified

186 * `override` will merge with the existing query (use `undefined` to unset).
187 */
188export const redirect = (req: express.Request, res: express.Response, to: string, override: qs.ParsedQs = {}): void => {
189 const query = Object.assign({}, req.query, override)
190 Object.keys(override).forEach((key) => {
191 if (typeof override[key] === "undefined") {
192 delete query[key]
193 }
194 })
195
196 const redirectPath = constructRedirectPath(req, query, to)
197 logger.debug(`redirecting from ${req.originalUrl} to ${redirectPath}`)
198 res.redirect(redirectPath)
199}
200
201/**
202 * Get the value that should be used for setting a cookie domain. This will

Callers 6

domainProxy.tsFile · 0.90
registerFunction · 0.90
login.tsFile · 0.90
vscode.tsFile · 0.90
proxyFunction · 0.90
logout.tsFile · 0.90

Calls 1

constructRedirectPathFunction · 0.85

Tested by

no test coverage detected