Skip to content

Commit 33e0ba9

Browse files
benz0lirenkun-ken
andauthored
Support trailing slash in code-server's URI template (#1241)
* Update vsc.R * Modify url to allow proxied requests * Minor update * Fix message for webview * Support both single and double brackets * Support trailing slash Co-authored-by: Kun Ren <renkun@outlook.com>
1 parent ec8b214 commit 33e0ba9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/session/vsc.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ show_browser <- function(url, title = url, ...,
542542
if (nzchar(proxy_uri)) {
543543
is_base_path <- grepl("\\:\\d+$", url)
544544
url <- sub("^https?\\://(127\\.0\\.0\\.1|localhost)(\\:)?",
545-
sub("\\{\\{?port\\}\\}?", "", proxy_uri), url)
545+
sub("\\{\\{?port\\}\\}?/?", "", proxy_uri), url)
546546
if (is_base_path) {
547547
url <- paste0(url, "/")
548548
}
@@ -599,7 +599,7 @@ show_webview <- function(url, title, ..., viewer) {
599599
if (nzchar(proxy_uri)) {
600600
is_base_path <- grepl("\\:\\d+$", url)
601601
url <- sub("^https?\\://(127\\.0\\.0\\.1|localhost)(\\:)?",
602-
sub("\\{\\{?port\\}\\}?", "", proxy_uri), url)
602+
sub("\\{\\{?port\\}\\}?/?", "", proxy_uri), url)
603603
if (is_base_path) {
604604
url <- paste0(url, "/")
605605
}

0 commit comments

Comments
 (0)