hi. in routr's ressource_route() function, there is a line
m_since <- request$get_header('If-Modified-Since')
it appears get_header returns a vector of length 2, the first being day-name, which is separated by a comma from the second element (day, month, year, ...).
when in the subsequent if statement, m_since is fed to from_http_date(), i'm guessing two NAs result. which, it appears, results in the subject error message.
i took a quick look in the code in request.R, but didn't immediately see where the headers are set (maybe not even in reqres? in fiery? httpuv?).
a hack in routr would be something like
diff --git a/R/ressource_route.R b/R/ressource_route.R
index 02021fe..cb990a9 100644
--- a/R/ressource_route.R
+++ b/R/ressource_route.R
@@ -143,6 +143,10 @@ ressource_route <- function(..., default_file = 'index.html', default_ext = 'htm
m_time <- file.mtime(real_file)
etag <- request$get_header('If-None-Match')
new_tag <- digest(m_time)
+ if (!is.null(m_since)) {
+ m_since <- paste(m_since, collapse=", ")
+ }
if ((!is.null(m_since) && from_http_date(m_since) < m_time) ||
(!is.null(etag) && etag == new_tag)) {
response$status_with_text(304L)
cheers.
hi. in routr's
ressource_route()function, there is a lineit appears get_header returns a vector of length 2, the first being day-name, which is separated by a comma from the second element (day, month, year, ...).
when in the subsequent if statement,
m_sinceis fed tofrom_http_date(), i'm guessing twoNAsresult. which, it appears, results in the subject error message.i took a quick look in the code in request.R, but didn't immediately see where the
headersare set (maybe not even in reqres? in fiery? httpuv?).a hack in routr would be something like
cheers.