mirror of
https://github.com/coder/code-server.git
synced 2025-07-30 13:32:59 +08:00
Rename hxxp to isHttp
This commit is contained in:
@ -168,15 +168,15 @@ export class ProxyHttpProvider extends HttpProvider implements HttpProxyProvider
|
|||||||
// the event.
|
// the event.
|
||||||
;(request as Request).base = base
|
;(request as Request).base = base
|
||||||
|
|
||||||
const hxxp = response instanceof http.ServerResponse
|
const isHttp = response instanceof http.ServerResponse
|
||||||
const path = base ? route.fullPath.replace(base, "") : route.fullPath
|
const path = base ? route.fullPath.replace(base, "") : route.fullPath
|
||||||
const options: proxy.ServerOptions = {
|
const options: proxy.ServerOptions = {
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
ignorePath: true,
|
ignorePath: true,
|
||||||
target: `${hxxp ? "http" : "ws"}://127.0.0.1:${port}${path}${
|
target: `${isHttp ? "http" : "ws"}://127.0.0.1:${port}${path}${
|
||||||
Object.keys(route.query).length > 0 ? `?${querystring.stringify(route.query)}` : ""
|
Object.keys(route.query).length > 0 ? `?${querystring.stringify(route.query)}` : ""
|
||||||
}`,
|
}`,
|
||||||
ws: !hxxp,
|
ws: !isHttp,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response instanceof http.ServerResponse) {
|
if (response instanceof http.ServerResponse) {
|
||||||
|
Reference in New Issue
Block a user