mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 23:48:01 -05:00
Compare commits
3 Commits
v1.10.0
...
session-to
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9444bf82ee | ||
|
|
70114125ba | ||
|
|
02ea53c5e9 |
2
.github/workflows/R-CMD-check.yaml
vendored
2
.github/workflows/R-CMD-check.yaml
vendored
@@ -21,3 +21,5 @@ jobs:
|
||||
node-version: "14.x"
|
||||
R-CMD-check:
|
||||
uses: rstudio/shiny-workflows/.github/workflows/R-CMD-check.yaml@v1
|
||||
with:
|
||||
cache-version: "2.1"
|
||||
|
||||
20
R/shiny.R
20
R/shiny.R
@@ -1876,6 +1876,26 @@ ShinySession <- R6Class(
|
||||
# Provides a mechanism for handling direct HTTP requests that are posted
|
||||
# to the session (rather than going through the websocket)
|
||||
handleRequest = function(req) {
|
||||
if (!is.null(self$user)) {
|
||||
if (is.null(req$HTTP_SHINY_SERVER_CREDENTIALS)) {
|
||||
# Session owner is logged in, but this requester is not
|
||||
return(NULL)
|
||||
}
|
||||
|
||||
requestUser <- NULL
|
||||
try(
|
||||
{
|
||||
creds <- safeFromJSON(req$HTTP_SHINY_SERVER_CREDENTIALS)
|
||||
requestUser <- creds$user
|
||||
},
|
||||
silent = TRUE
|
||||
)
|
||||
if (!identical(self$user, requestUser)) {
|
||||
# This requester is not the same user as session owner
|
||||
return(NULL)
|
||||
}
|
||||
}
|
||||
|
||||
# TODO: Turn off caching for the response
|
||||
subpath <- req$PATH_INFO
|
||||
|
||||
|
||||
Reference in New Issue
Block a user