felixge / felixge/httpsnoop

superfluous response.WriteHeader call

未关闭
#32 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
1.2k
派生
48
PR 合并指标
30 天内没有已合并 PR

描述

`http: superfluous response.WriteHeader call from github.com/felixge/httpsnoop.(*Metrics).CaptureMetrics.func1.1 (capture_metrics.go:53)`

I sometimes get this error in my logs when serving static files with `http.ServeContent`.

Not sure how this happens if the wrapper is working correctly but the logs don't lie. Maybe `ServeContent` is somehow getting direct access to the underlying writer?

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 capture_metrics.go:53 开始,跟踪 httpsnoop 在对静态文件执行 http.ServeContent 期间如何包装 response writer。使用一个最小 handler 重现报告中的日志,然后将 wrapper 的 WriteHeader 调用与 ServeContent 的行为进行比较。当原因得到确定,且受影响情况下不再出现 superfluous-call log 时,即视为完成。

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

评估

技术栈
go
领域
backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

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