Silent failure when staticPaths points to a file instead of a directory
还没有人认领这个 Issue。
评估
调研方向
Start with the staticPaths and staticPathOptions handling used by startServer, then reproduce the /foo/bar request with the example app and curl. Determine how a file-valued static path is handled, and make the behavior report an explicit error instead of failing silently; verify the request no longer produces an unexplained 500.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- C
- 星标
- 252
- 派生
- 87
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rstudio/httpuv 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
难度 4/5 3-5 天 新手友好度 46/100
-
难度 5/5 一周以上 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
Status: Opened
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
FriendsofECCE/ECCE#1018 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
immortalwrt/immortalwrt#2522 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
severity: low
难度 2/5 1-3 小时 新手友好度 64/100
luainkernel/lunatik#2530 ·
维护者通常 1 天内回复