Skip to content

Commit 88e7aac

Browse files
benz0lirenkun-ken
andauthored
Support both single and double brackets in code-server's URI template (#934)
* Update vsc.R * Modify url to allow proxied requests * Minor update * Fix message for webview * Support both single and double brackets Co-authored-by: Kun Ren <[email protected]>
1 parent fbe7b5e commit 88e7aac

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
@@ -516,7 +516,7 @@ show_browser <- function(url, title = url, ...,
516516
if (nzchar(proxy_uri)) {
517517
is_base_path <- grepl("\\:\\d+$", url)
518518
url <- sub("^https?\\://(127\\.0\\.0\\.1|localhost)(\\:)?",
519-
sub("{port}", "", proxy_uri, fixed = TRUE), url)
519+
sub("\\{\\{?port\\}\\}?", "", proxy_uri), url)
520520
if (is_base_path) {
521521
url <- paste0(url, "/")
522522
}
@@ -573,7 +573,7 @@ show_webview <- function(url, title, ..., viewer) {
573573
if (nzchar(proxy_uri)) {
574574
is_base_path <- grepl("\\:\\d+$", url)
575575
url <- sub("^https?\\://(127\\.0\\.0\\.1|localhost)(\\:)?",
576-
sub("{port}", "", proxy_uri, fixed = TRUE), url)
576+
sub("\\{\\{?port\\}\\}?", "", proxy_uri), url)
577577
if (is_base_path) {
578578
url <- paste0(url, "/")
579579
}

0 commit comments

Comments
 (0)