You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if the default file is used (because the path ends in '/'), it appears that the file extension isn't set, and the file is returned, but with an incorrect 'content-type' (i assume it is):
bash % wget -v http://127.0.0.1:8080
--2020-11-09 20:22:48-- http://127.0.0.1:8080/
Connecting to 127.0.0.1:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1321 (1.3K) [text/plain]
Saving to: ‘index.html.2’
index.html.2 100%[======================================================================================================>] 1.29K --.-KB/s in 0s
2020-11-09 20:22:48 (136 MB/s) - ‘index.html.2’ saved [1321/1321]
this patch, which sets the default file earlier in the handler, seems to fix that. (what it breaks, ...?)
diff --git a/R/ressource_route.R b/R/ressource_route.R
index 549d856..02021fe 100644
--- a/R/ressource_route.R
+++ b/R/ressource_route.R
@@ -109,13 +109,13 @@ ressource_route <- function(..., default_file = 'index.html', default_ext = 'htm
assert_that(has_attr(mappings, 'names'))
route$add_handler('get', '/*', function(request, response, keys, ...) {
path <- request$path
+ if (grepl('/$', path)) path <- paste0(path, default_file)
file_extension <- file_ext(path)
has_ext <- file_extension != ''
found <- FALSE
file <- NA
enc <- NA
real_file <- NA
- if (grepl('/$', path)) path <- paste0(path, default_file)
for (i in seq_along(mappings)) {
mount <- names(mappings)[i]
if (!grepl(paste0('^', mount), path)) next
with this patch, here is how wget runs
bash % wget http://127.0.0.1:8080
--2020-11-09 20:39:15-- http://127.0.0.1:8080/
Connecting to 127.0.0.1:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1321 (1.3K) [text/html]
Saving to: ‘index.html.3’
index.html.3 100%[======================================================================================================>] 1.29K --.-KB/s in 0s
2020-11-09 20:39:15 (126 MB/s) - ‘index.html.3’ saved [1321/1321]
(this seems to make the browser launched by fiery::Fire$ignite()'s showcase work, at least for me.)
The text was updated successfully, but these errors were encountered:
if the default file is used (because the path ends in '/'), it appears that the file extension isn't set, and the file is returned, but with an incorrect 'content-type' (i assume it is):
this patch, which sets the default file earlier in the handler, seems to fix that. (what it breaks, ...?)
with this patch, here is how
wget
runs(this seems to make the browser launched by
fiery::Fire$ignite()
'sshowcase
work, at least for me.)The text was updated successfully, but these errors were encountered: