diff --git a/R/graph.R b/R/graph.R
index 0ecb669c7..f50c91559 100644
--- a/R/graph.R
+++ b/R/graph.R
@@ -55,7 +55,7 @@ renderReactLog <- function() {
}
.graphAppend <- function(logEntry, domain = getDefaultReactiveDomain()) {
- if (isTRUE(getOption('shiny.reactlog', FALSE)))
+ if (isTRUE(getOption('shiny.reactlog')))
.graphEnv$log <- c(.graphEnv$log, list(logEntry))
if (!is.null(domain)) {
diff --git a/R/imageutils.R b/R/imageutils.R
index 54aa14f3a..d0311b290 100644
--- a/R/imageutils.R
+++ b/R/imageutils.R
@@ -34,7 +34,7 @@ plotPNG <- function(func, filename=tempfile(fileext='.png'),
# Finally, if neither quartz nor Cairo, use png().
if (capabilities("aqua")) {
pngfun <- png
- } else if (getOption('shiny.usecairo', TRUE) &&
+ } else if ((getOption('shiny.usecairo') %OR% TRUE) &&
nchar(system.file(package = "Cairo"))) {
pngfun <- Cairo::CairoPNG
} else {
diff --git a/R/middleware-shiny.R b/R/middleware-shiny.R
index a0dd7312e..e0022520b 100644
--- a/R/middleware-shiny.R
+++ b/R/middleware-shiny.R
@@ -5,7 +5,7 @@ reactLogHandler <- function(req) {
if (!identical(req$PATH_INFO, '/reactlog'))
return(NULL)
- if (!getOption('shiny.reactlog', FALSE)) {
+ if (!isTRUE(getOption('shiny.reactlog'))) {
return(NULL)
}
diff --git a/R/middleware.R b/R/middleware.R
index 4c3b7262f..fcf2816ad 100644
--- a/R/middleware.R
+++ b/R/middleware.R
@@ -281,7 +281,7 @@ HandlerManager <- setRefClass("HandlerManager",
createHttpuvApp = function() {
list(
onHeaders = function(req) {
- maxSize <- getOption('shiny.maxRequestSize', 5 * 1024 * 1024)
+ maxSize <- getOption('shiny.maxRequestSize') %OR% (5 * 1024 * 1024)
if (maxSize <= 0)
return(NULL)
@@ -306,7 +306,7 @@ HandlerManager <- setRefClass("HandlerManager",
function (req) {
return(handlers$invoke(req))
},
- getOption('shiny.sharedSecret', NULL)
+ getOption('shiny.sharedSecret')
),
onWSOpen = function(ws) {
return(wsHandlers$invoke(ws))
@@ -314,7 +314,7 @@ HandlerManager <- setRefClass("HandlerManager",
)
},
.httpServer = function(handler, sharedSecret) {
- filter <- getOption('shiny.http.response.filter', NULL)
+ filter <- getOption('shiny.http.response.filter')
if (is.null(filter))
filter <- function(req, response) response
@@ -329,11 +329,11 @@ HandlerManager <- setRefClass("HandlerManager",
response <- handler(req)
if (is.null(response))
response <- httpResponse(404, content="
Not Found
")
-
+
if (inherits(response, "httpResponse")) {
headers <- as.list(response$headers)
headers$'Content-Type' <- response$content_type
-
+
response <- filter(req, response)
return(list(status=response$status,
body=response$content,
diff --git a/R/react.R b/R/react.R
index 78d0ec4d9..19365d62b 100644
--- a/R/react.R
+++ b/R/react.R
@@ -98,7 +98,7 @@ ReactiveEnvironment <- setRefClass(
},
currentContext = function() {
if (is.null(.currentContext)) {
- if (isTRUE(getOption('shiny.suppressMissingContextError', FALSE))) {
+ if (isTRUE(getOption('shiny.suppressMissingContextError'))) {
return(getDummyContext())
} else {
stop('Operation not allowed without an active reactive context. ',
@@ -138,7 +138,7 @@ ReactiveEnvironment <- setRefClass(
reactiveEnvironment <<- ReactiveEnvironment$new()
return(reactiveEnvironment)
}
-})
+})
# Causes any pending invalidations to run.
flushReact <- function() {
diff --git a/R/server.R b/R/server.R
index f81013c38..7caaa5744 100644
--- a/R/server.R
+++ b/R/server.R
@@ -278,7 +278,7 @@ createAppHandlers <- function(httpHandlers, serverFuncSource) {
# This value, if non-NULL, must be present on all HTTP and WebSocket
# requests as the Shiny-Shared-Secret header or else access will be
# denied (403 response for HTTP, and instant close for websocket).
- sharedSecret <- getOption('shiny.sharedSecret', NULL)
+ sharedSecret <- getOption('shiny.sharedSecret')
appHandlers <- list(
http = joinHandlers(c(
@@ -303,7 +303,7 @@ createAppHandlers <- function(httpHandlers, serverFuncSource) {
if (is.character(msg))
msg <- charToRaw(msg)
- if (getOption('shiny.trace', FALSE)) {
+ if (isTRUE(getOption('shiny.trace'))) {
if (binary)
message("RECV ", '$$binary data$$')
else
diff --git a/R/shiny.R b/R/shiny.R
index 23263745a..1a6d7ea01 100644
--- a/R/shiny.R
+++ b/R/shiny.R
@@ -493,7 +493,7 @@ ShinySession <- setRefClass(
if (closed){
return()
}
- if (getOption('shiny.trace', FALSE))
+ if (isTRUE(getOption('shiny.trace')))
message('SEND ',
gsub('(?m)base64,[a-zA-Z0-9+/=]+','[base64 data]',json,perl=TRUE))
# first convert to native encoding, then to UTF8, otherwise we may get the
diff --git a/R/shinywrappers.R b/R/shinywrappers.R
index b9091bbbe..e673a42d4 100644
--- a/R/shinywrappers.R
+++ b/R/shinywrappers.R
@@ -317,7 +317,7 @@ renderTable <- function(expr, ..., env=parent.frame(), quoted=FALSE, func=NULL)
}
markRenderFunction(tableOutput, function() {
- classNames <- getOption('shiny.table.class', 'data table table-bordered table-condensed')
+ classNames <- getOption('shiny.table.class') %OR% 'data table table-bordered table-condensed'
data <- func()
if (is.null(data) || identical(data, data.frame()))
diff --git a/R/utils.R b/R/utils.R
index e352b0e4a..4b9af8299 100644
--- a/R/utils.R
+++ b/R/utils.R
@@ -487,7 +487,7 @@ shinyCallingHandlers <- function(expr) {
shinyDeprecated <- function(new=NULL, msg=NULL,
old=as.character(sys.call(sys.parent()))[1L]) {
- if (getOption("shiny.deprecation.messages", default=TRUE) == FALSE)
+ if (getOption("shiny.deprecation.messages") %OR% TRUE == FALSE)
return(invisible())
if (is.null(msg)) {