Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent failure when staticPaths points to a file instead of a directory #267

Open
viking opened this issue May 8, 2020 · 0 comments
Open

Comments

@viking
Copy link

viking commented May 8, 2020

Given this app:

app <- list(
  call = function(req) {
    list(status = 404L,
         headers = list('Content-Type' = 'text/plain'),
         body = "Not found")
  },
  staticPaths = list(
    "/foo" = "foo.html"
  ),
  staticPathOptions = staticPathOptions(fallthrough = TRUE)
)
s <- startServer('127.0.0.1', 31337, app)

Any attempts to fetch a subpath under /foo will fail silently:

$ curl -v http://localhost:31337/foo/bar
*   Trying 127.0.0.1:31337...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 31337 (#0)
> GET /foo/bar HTTP/1.1
> Host: localhost:31337
> User-Agent: curl/7.66.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Date: Fri, 08 May 2020 02:20:02 GMT
< Content-Length: 26
< 
500 Internal Server Error
* Connection #0 to host localhost left intact

There is no error in the R console when this request is made.

This may not be a bug per se, but if specifying a file instead of a directory in staticPaths is not allowed, I would have expected some sort of error telling me so. Let me know if I can provide any further information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant