nodeSolidServer / nodeSolidServer/node-solid-server

Requesting binaries with invalid Accept headers should 406, not 500

未关闭
#440 9 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

cannot-reproduce
主要语言
JavaScript
星标
1.8k
派生
308
PR 合并指标
30 天内没有已合并 PR

描述

Reported by @timbl:

If you request a non-rdf resource (say a PDF file) with an accept header like Accept:image/*;q=0.9, application/rdf+xml, application/xhtml+xml, text/xml;q=0.2, application/xml;q=0.2, text/html;q=0.3, text/plain;q=0.1, text/n3;q=1.0, application/x-turtle;q=1, text/turtle;q=1, the server will try to convert it from PDF to RDF, and fail with a 500 error.
Should instead return a 406 Unacceptable.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 issue 中显示的 Accept 标头,针对 PDF 等非 RDF 二进制文件重现该请求,然后跟踪服务器的内容协商和转换路径。未支持的转换返回 HTTP 406 Not Acceptable 而不是 HTTP 500,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
api, backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。