rstudio / httpuv

HTTP and WebSocket server package for R
Other
229 stars 86 forks source link

Static file serving doesn't work on Windows when non-ASCII chars are in path #224

Closed wch closed 5 years ago

wch commented 5 years ago

Example:

dir.create('fü')
writeLines("Hello world!", 'fü/index.html')

dir.create('foo')
writeLines("Hello world!", 'foo/index.html')

library(httpuv)

s <- startServer("0.0.0.0", 5000,
  list(
    call = function(req) {},
    staticPaths = list(
      "/bad" = "fü",
      "/good" = "foo"
    )
  )
)

# s$stop()

After running this code, visit http://localhost:5000/bad and http://localhost:5000/good. The first one maps to fü, and it will give a 404. The second one maps to foo, and it works correctly.