Skip to content

Commit 3db681e

Browse files
authored
Add X-RS-Session-Server-RPC-Cookie header to requests (#565)
1 parent fc00d70 commit 3db681e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

R/launchers.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ launch_remote <- function(n = 1L, remote = remote_config(), ..., .compute = NULL
9696
cookie <- if (is.function(remote[["cookie"]])) remote[["cookie"]]() else remote[["cookie"]]
9797
token <- if (is.function(remote[["token"]])) remote[["token"]]() else remote[["token"]]
9898
data <- if (is.function(remote[["data"]])) remote[["data"]]() else remote[["data"]]
99-
headers <- c(Authorization = sprintf("Bearer %s", token), Cookie = cookie)
99+
headers <- c(
100+
Authorization = sprintf("Bearer %s", token),
101+
Cookie = cookie,
102+
`X-RS-Session-Server-RPC-Cookie` = cookie
103+
)
100104
res <- lapply(seq_len(n), function(i) {
101105
cmd <- write_args(url, dots, maybe_next_stream(envir), tls)
102106
cmd <- gsub("\\", "\\\\", cmd, fixed = TRUE)
@@ -556,7 +560,7 @@ posit_workbench_get <- function(what, rscript = NULL) {
556560
nzchar(url) && nzchar(cookie) || stop(._[["posit_api"]])
557561
envs <- ncurl(
558562
file.path(url, "api", "get_compute_envs"),
559-
headers = c(Cookie = cookie),
563+
headers = c(Cookie = cookie, `X-RS-Session-Server-RPC-Cookie` = cookie),
560564
timeout = .limit_short
561565
)
562566
envs[["status"]] == 200L || stop(._[["posit_api"]])

0 commit comments

Comments
 (0)