Skip to content

Commit 1e88990

Browse files
committed
Fix serving of www/index.html. Closes rstudio#2380
1 parent de4c756 commit 1e88990

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

R/app.R

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,13 @@ shinyAppDir_serverR <- function(appDir, options=list()) {
228228
structure(
229229
list(
230230
staticPaths = staticPaths,
231-
httpHandler = joinHandlers(c(uiHandler, fallbackWWWDir)),
231+
# Even though the wwwDir is handled as a static path, we need to include
232+
# it here to be handled by R as well. This is because the special case
233+
# of index.html: it is specifically not handled as a staticPath for
234+
# reasons explained above, but if someone does want to serve up an
235+
# index.html, we need to handle it, and we do it by using the
236+
# staticHandler in the R code path. (#2380)
237+
httpHandler = joinHandlers(c(uiHandler, wwwDir, fallbackWWWDir)),
232238
serverFuncSource = serverFuncSource,
233239
onStart = onStart,
234240
onStop = onStop,
@@ -355,7 +361,13 @@ shinyAppDir_appR <- function(fileName, appDir, options=list())
355361
# uiHandler, then falbackWWWDir (which is served up by the R
356362
# staticHandler function).
357363
staticPaths = staticPaths,
358-
httpHandler = joinHandlers(c(dynHttpHandler, fallbackWWWDir)),
364+
# Even though the wwwDir is handled as a static path, we need to include
365+
# it here to be handled by R as well. This is because the special case
366+
# of index.html: it is specifically not handled as a staticPath for
367+
# reasons explained above, but if someone does want to serve up an
368+
# index.html, we need to handle it, and we do it by using the
369+
# staticHandler in the R code path. (#2380)
370+
httpHandler = joinHandlers(c(dynHttpHandler, wwwDir, fallbackWWWDir)),
359371
serverFuncSource = dynServerFuncSource,
360372
onStart = onStart,
361373
onStop = onStop,

0 commit comments

Comments
 (0)