This commit is contained in:
孟帅
2024-03-08 10:32:07 +08:00
parent 0fbc1ad47c
commit f0bf193077
11 changed files with 12 additions and 14 deletions

1
server/.gitignore vendored
View File

@@ -36,3 +36,4 @@ main.exe~
!hotgo/
*.lock
/bin/package.sh
internal/packed/packed.go

View File

@@ -3,8 +3,8 @@
gfcli:
build:
name: "hotgo" # 编译后的可执行文件名称
# arch: "all" #不填默认当前系统架构可选386,amd64,arm,all
# system: "all" #不填默认当前系统平台可选linux,darwin,windows,all
arch: "amd64" # 不填默认当前系统架构可选386,amd64,arm,all
system: "linux" # 不填默认当前系统平台可选linux,darwin,windows,all
mod: "none"
cgo: 0
packSrc: "resource" # 将resource目录打包进可执行文件静态资源无需单独部署

View File

@@ -12,7 +12,6 @@ import (
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/util/gmeta"
"hotgo/internal/consts"
"hotgo/internal/library/contexts"
"hotgo/internal/library/response"
"hotgo/utility/charset"
"hotgo/utility/simple"
@@ -34,7 +33,7 @@ func (s *sMiddleware) ResponseHandler(r *ghttp.Request) {
contentType := getContentType(r)
// 已存在响应
if contentType != consts.HTTPContentTypeStream && r.Response.BufferLength() > 0 && contexts.Get(r.Context()).Response != nil {
if contentType != consts.HTTPContentTypeStream && r.Response.BufferLength() > 0 { // && contexts.Get(r.Context()).Response != nil
return
}