Skip to content

Commit

Permalink
Support both single and double brackets in code-server's URI template (
Browse files Browse the repository at this point in the history
…#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 <renkun@outlook.com>
  • Loading branch information
benz0li and renkun-ken committed Jan 6, 2022
1 parent fbe7b5e commit 88e7aac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/session/vsc.R
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ show_browser <- function(url, title = url, ...,
if (nzchar(proxy_uri)) {
is_base_path <- grepl("\\:\\d+$", url)
url <- sub("^https?\\://(127\\.0\\.0\\.1|localhost)(\\:)?",
sub("{port}", "", proxy_uri, fixed = TRUE), url)
sub("\\{\\{?port\\}\\}?", "", proxy_uri), url)
if (is_base_path) {
url <- paste0(url, "/")
}
Expand Down Expand Up @@ -573,7 +573,7 @@ show_webview <- function(url, title, ..., viewer) {
if (nzchar(proxy_uri)) {
is_base_path <- grepl("\\:\\d+$", url)
url <- sub("^https?\\://(127\\.0\\.0\\.1|localhost)(\\:)?",
sub("{port}", "", proxy_uri, fixed = TRUE), url)
sub("\\{\\{?port\\}\\}?", "", proxy_uri), url)
if (is_base_path) {
url <- paste0(url, "/")
}
Expand Down

0 comments on commit 88e7aac

Please sign in to comment.