Skip to content

Commit

Permalink
Support trailing slash in code-server's URI template (#1241)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
benz0li and renkun-ken authored Oct 27, 2022
1 parent ec8b214 commit 33e0ba9
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 @@ -542,7 +542,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), url)
sub("\\{\\{?port\\}\\}?/?", "", proxy_uri), url)
if (is_base_path) {
url <- paste0(url, "/")
}
Expand Down Expand Up @@ -599,7 +599,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), url)
sub("\\{\\{?port\\}\\}?/?", "", proxy_uri), url)
if (is_base_path) {
url <- paste0(url, "/")
}
Expand Down

0 comments on commit 33e0ba9

Please sign in to comment.