Skip to content

Commit fd0991f

Browse files
committed
Revert "feature/codespaces proxy url (#4683)"
This reverts commit 65ae9bd.
1 parent da19435 commit fd0991f

File tree

4 files changed

+0
-35
lines changed

4 files changed

+0
-35
lines changed

news/changelog-1.3.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
## Preview
165165

166166
- Correct redirect for VS Code Server (#3352) (Thank you, @benz0li!)
167-
- Correct redirect for GitHub Codespaces
168167

169168
## LUA
170169

src/command/preview/preview.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ import { projectOutputDir } from "../../project/project-shared.ts";
7474
import { projectContext } from "../../project/project-context.ts";
7575
import { normalizePath, pathWithForwardSlashes } from "../../core/path.ts";
7676
import {
77-
gitHubCodeSpacesProxyUri,
78-
isGitHubCodespaces,
7977
isJupyterHubServer,
8078
isRStudioServer,
8179
isRStudioWorkbench,
@@ -752,9 +750,6 @@ function pdfFileRequestHandler(
752750
: isVSCodeServer()
753751
? vsCodeServerProxyUri()!.replace("{{port}}", `${port}`) +
754752
kPdfJsInitialPath
755-
: isGitHubCodespaces()
756-
? gitHubCodeSpacesProxyUri()!.replace("{{port}}", `${port}`) +
757-
kPdfJsInitialPath
758753
: "/" + kPdfJsInitialPath;
759754
return Promise.resolve(serveRedirect(url));
760755
} else {

src/command/render/render-shared.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import { resourceFilesFromRenderedFile } from "./resources.ts";
2121
import { RenderFlags, RenderOptions, RenderResult } from "./types.ts";
2222
import { fileExecutionEngine } from "../../execute/engine.ts";
2323
import {
24-
gitHubCodeSpacesProxyUri,
25-
isGitHubCodespaces,
2624
isJupyterHubServer,
2725
isJupyterServer,
2826
isRStudioServer,
@@ -190,10 +188,6 @@ export async function printBrowsePreviewMessage(
190188
const browseUrl = proxyUrl.replace("{{port}}", `${port}`) +
191189
path;
192190
info(`\nBrowse at ${browseUrl}`, { format: colors.green });
193-
} else if (isVSCodeTerminal() && isGitHubCodespaces()) {
194-
const browseUrl =
195-
gitHubCodeSpacesProxyUri()!.replace("{{port}}", `${port}`) + path;
196-
info(`\nBrowse at ${browseUrl}`, { format: colors.green });
197191
} else if (isJupyterHubServer()) {
198192
const httpReferrer = `${
199193
jupyterHubHttpReferrer() || "<jupyterhub-server-url>/"

src/core/platform.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,6 @@ export function isVSCodeTerminal() {
3333
return Deno.env.get("TERM_PROGRAM") === "vscode";
3434
}
3535

36-
export function gitHubCodespaceName() {
37-
return Deno.env.get("CODESPACE_NAME");
38-
}
39-
40-
export function gitHubCodespacePortForwardingDomain() {
41-
return Deno.env.get("GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN");
42-
}
43-
44-
export function isGitHubCodespaces() {
45-
return !!gitHubCodespacePortForwardingDomain() && !!gitHubCodespaceName();
46-
}
47-
48-
export function gitHubCodeSpacesProxyUri() {
49-
const CODESPACE_NAME = gitHubCodespaceName();
50-
const GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN =
51-
gitHubCodespacePortForwardingDomain();
52-
if (CODESPACE_NAME && GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN) {
53-
return `https://${CODESPACE_NAME}-{{port}}.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}`;
54-
} else {
55-
return undefined;
56-
}
57-
}
58-
5936
export function isVSCodeServer() {
6037
return !!vsCodeServerProxyUri();
6138
}

0 commit comments

Comments
 (0)