I put two test files under /data/download:test.txt , 测试.txt
After executing the following plumber code, visit
http://ip:8001/download/test.txt
http://ip:8001/download/ 测试.txt
Should be able to see the data,But the first one is normal, and the second one is 404
Even more strange is this 404 cannot be caught by pr_set_404()
Does it not support Chinese file names?
What should I do?
library(plumber)
handler_404 <- function(req, res) {
print("---------")
print(req)
print("---------")
res$status <- 404
res$body <- "Oops! There's nothing you want"
}
pr() %>%
pr_static("/download", "/data/download") %>%
pr_run(port = 8001, host = "0.0.0.0") %>%
pr_set_404(handler_404)