Skip to content

Commit

Permalink
修复证书解析失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Dot-Liu committed Nov 9, 2023
1 parent a287c03 commit cdad527
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/plugins/extra-params_v2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (c *Config) doCheck() error {
}
}
c.RequestBodyType = strings.ToLower(c.RequestBodyType)
if contentTypeMap[c.RequestBodyType] == "" {
if contentTypeMap[c.RequestBodyType] == "" && c.RequestBodyType != "" {
return fmt.Errorf("error body type: %s", c.RequestBodyType)
}
return nil
Expand Down
9 changes: 8 additions & 1 deletion entries/http-entry/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,19 @@ var (
return ctx.Request().RealIp(), true
}),
"src_port": ReadFunc(func(name string, ctx http_service.IHttpContext) (interface{}, bool) {
return ctx.Request().RemotePort(), true
port, err := strconv.Atoi(ctx.Request().RemotePort())
if err != nil {
return nil, false
}
return port, true
}),
"uri": ReadFunc(func(name string, ctx http_service.IHttpContext) (interface{}, bool) {
//不带请求参数的uri
return ctx.Request().URI().Path(), true
}),
"url": ReadFunc(func(name string, ctx http_service.IHttpContext) (interface{}, bool) {
return ctx.Request().URI().RawURL(), true
}),
"content_length": ReadFunc(func(name string, ctx http_service.IHttpContext) (interface{}, bool) {
return ctx.Request().Header().GetHeader("content-length"), true
}),
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/clbanning/mxj v1.8.4
github.com/coocood/freecache v1.2.2
github.com/dubbogo/gost v1.13.1
github.com/eolinker/eosc v0.15.1
github.com/eolinker/eosc v0.15.2
github.com/fasthttp/websocket v1.5.0
github.com/fullstorydev/grpcurl v1.8.7
github.com/go-redis/redis/v8 v8.11.5
Expand Down
2 changes: 1 addition & 1 deletion node/fasthttp-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func ProxyTimeout(scheme string, node eocontext.INode, req *fasthttp.Request, re
if err != nil {
return nil, err
}
addr := fmt.Sprintf("%s://%s:%d", scheme, tcpAddr.IP.String(), tcpAddr.Port)
addr := fmt.Sprintf("%s://%s", scheme, node.Addr())
err = defaultClient.ProxyTimeout(addr, req, resp, timeout)
if err != nil {
node.Down()
Expand Down

0 comments on commit cdad527

Please sign in to comment.