Skip to content

Commit

Permalink
fix: 查询参数不能传递到插件进行处理的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
袁沅祥 committed Sep 4, 2023
1 parent 8bac7f9 commit a13120c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ type ServiceConfig struct {
ClientTLS *ClientTLS `mapstructure:"client_tls"`
}

// NormalizeEndpoints 处理[]*EndpointConfig每个元素, 标准化Endpoint, 设置QueryString.
func (s *ServiceConfig) NormalizeEndpoints() {
subject := NewURIParser()
for _, e := range s.Endpoints {
params := s.extractPlaceHoldersFromURLTemplate(e.Endpoint, endpointURLKeysPattern)
ne := subject.GetEndpointPath(e.Endpoint, params)
e.Endpoint = ne
e.QueryString = []string{"*"}
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/yuanyuanxiang/lura/v2

replace github.com/luraproject/lura/v2 => github.com/yuanyuanxiang/lura/v2 v2.0.8
replace github.com/luraproject/lura/v2 => github.com/yuanyuanxiang/lura/v2 v2.0.9

go 1.17

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ github.com/urfave/negroni/v2 v2.0.2 h1:27gJcVxYJ2a/ytEoCHoJ7ybvyhymV4cAhGuMxkyCs
github.com/urfave/negroni/v2 v2.0.2/go.mod h1:SjdApKzYrObukpN/NnlejbQiZWIUjfDFzQltScGYigI=
github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8=
github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ=
github.com/yuanyuanxiang/lura/v2 v2.0.8 h1:nthxhzT/MUGi9Y0GPaYYdiFdAjOiGUjAd/m7RfO//S4=
github.com/yuanyuanxiang/lura/v2 v2.0.8/go.mod h1:ejGC3lrXscEbvL38oDy92+YO/OOZQN4IxSAiR+O3Ipc=
github.com/yuanyuanxiang/lura/v2 v2.0.9 h1:O+jf21uAL1jQ40miIPTcRJbFndwbR0/QnRsgsf0W4kM=
github.com/yuanyuanxiang/lura/v2 v2.0.9/go.mod h1:4uqHvonfuUenDf2/F3KVAO+leLvumurPH1tiBZRzUbU=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
Expand Down

0 comments on commit a13120c

Please sign in to comment.