mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-12-25 01:26:01 +08:00
fix pprof
This commit is contained in:
@@ -7,10 +7,11 @@ package consts
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model"
|
||||
"net/http"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -20,10 +21,11 @@ func init() {
|
||||
}
|
||||
|
||||
const (
|
||||
HTTPContentTypeXml = "text/xml"
|
||||
HTTPContentTypeHtml = "text/html"
|
||||
HTTPContentTypeStream = "text/event-stream"
|
||||
HTTPContentTypeJson = "application/json"
|
||||
HTTPContentTypeXml = "text/xml"
|
||||
HTTPContentTypeHtml = "text/html"
|
||||
HTTPContentTypeStream = "text/event-stream"
|
||||
HTTPContentTypeJson = "application/json"
|
||||
HTTPContentTypeOctetStream = "application/octet-stream"
|
||||
)
|
||||
|
||||
// HTTPMethodOptions HTTP请求方式选项
|
||||
|
||||
@@ -6,15 +6,16 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/response"
|
||||
"hotgo/utility/charset"
|
||||
"hotgo/utility/simple"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/response"
|
||||
"hotgo/utility/charset"
|
||||
"hotgo/utility/simple"
|
||||
)
|
||||
|
||||
// ResponseHandler HTTP响应预处理
|
||||
@@ -45,6 +46,7 @@ func (s *sMiddleware) ResponseHandler(r *ghttp.Request) {
|
||||
s.responseXml(r)
|
||||
return
|
||||
case consts.HTTPContentTypeStream:
|
||||
case consts.HTTPContentTypeOctetStream:
|
||||
default:
|
||||
responseJson(r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user