How to let the json file (*.json) return response header: 'application/json', instead of 'application/json; charset=UTF-8'
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
使用提供的 http-server 命令重现响应,并检查确定 .json 文件 Content-Type 的源代码。确认当前的标头行为,并找出相关的响应标头处理逻辑。完成的标准是 JSON 文件在没有 charset 后缀的情况下准确返回 application/json,并通过针对性测试或等效请求验证该行为。
由索引模型根据 Issue 内容生成。
描述
Environment Versions
- OS Type macOS
- Node version:
$ node --versionv12.22.12 - http-server version:
$ http-server --versionv14.1.1
Steps to reproduce
I have a json text file and start http-server
http-server ./public -c-1 -p 3000 --cors
What I got is: application/json; charset=UTF-8
How can I just let it return application/json?
I'm using latest http-server version, but I checked the source code, looks like this issue has been there from the very beginning.
Expected result
application/json
Actual result
application/json; charset=UTF-8
Thanks.
- 主要语言
- JavaScript
- 星标
- 14.2k
- 派生
- 1.6k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
http-party/http-server 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
http-party/http-server#982 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
http-party/http-server#977 · 2 个 reaction ·
-
难度 5/5 一周以上 新手友好度 8/100
http-party/http-server#980 · 2 条评论 ·
-
New chet未关闭
难度 5/5 一周以上 新手友好度 10/100
http-party/http-server#976 ·
-
Dreams local boy未关闭
难度 5/5 一周以上 新手友好度 15/100
http-party/http-server#975 ·
查看 http-party/http-server 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
ImranR98/apps.obtainium.imranr.dev#2000 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 2/5 1-3 小时 新手友好度 83/100
microsoft/monaco-editor#5577 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
obsidianmd/obsidian-help#1169 ·
维护者通常 2 天内回复
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish step可能已有人在做 @albertteoh 今天认领。 未关闭documentation
难度 2/5 1-3 小时 新手友好度 85/100
jaegertracing/jaeger-ui#4739 ·
维护者通常 1 天内回复