only partially follows range spec

未关闭
#771 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

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

调研方向

从 lib/core/index.js 第 272 行附近开始,使用以逗号分隔的 Range 请求(例如 bytes=10-15,17-30)重现该问题。检查 issue 中链接的 HTTP Range 规范,并验证响应是否处理了请求的两个范围,而不是在第一个范围处截断。

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

描述

stale
Environment Versions
  1. OS Type - win10
  2. http-server version: v14.0.0
Steps to reproduce

create a comma separated range request ex:
range: bytes=10-15,17-30

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range

Expected result

returns both ranges in the response

Actual result

only returns the first range,
https://github.com/http-party/http-server/blob/cf17c2fe97342f6a268bfb8fc79a2b82464c4d25/lib/core/index.js#L272
does not first split on ,
so request is truncated to equivalent of
range: bytes=10-15

主要语言
JavaScript
星标
14.2k
派生
1.6k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

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

http-party/http-server 的其他 Issue

查看 http-party/http-server 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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