fix: http2 content-length (#224)

This commit is contained in:
ShenLin
2025-06-20 17:57:14 +08:00
committed by GitHub
parent 0f5ed14fe2
commit 12540a8abc

View File

@ -51,6 +51,9 @@ func FsStream(c *gin.Context) {
}
dir, name := stdpath.Split(path)
sizeStr := c.GetHeader("Content-Length")
if sizeStr == "" {
sizeStr = "0"
}
size, err := strconv.ParseInt(sizeStr, 10, 64)
if err != nil {
common.ErrorResp(c, err, 400)