Skip to content

Commit

Permalink
backport #3410 to v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
benz0li authored and cscheid committed Jan 6, 2023
1 parent be74bb2 commit 3286654
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/command/preview/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ import {
isJupyterHubServer,
isRStudioServer,
isRStudioWorkbench,
isVSCodeServer,
vsCodeServerProxyUri,
} from "../../core/platform.ts";
import { isJupyterNotebook } from "../../core/jupyter/jupyter.ts";
import { watchForFileChanges } from "../../core/watch.ts";
Expand Down Expand Up @@ -690,6 +692,9 @@ function pdfFileRequestHandler(
if (new URL(req.url).pathname === "/") {
const url = isRStudioWorkbench()
? await rswURL(port, kPdfJsInitialPath)
: isVSCodeServer()
? vsCodeServerProxyUri()!.replace("{{port}}", `${port}`)
+ kPdfJsInitialPath
: "/" + kPdfJsInitialPath;
return Promise.resolve(serveRedirect(url));
} else {
Expand Down

0 comments on commit 3286654

Please sign in to comment.