mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-01 03:07:51 +08:00
Merge pull request #258 from GLYASAI/RAINBOND-818
[FIX] invalid value for ingress path
This commit is contained in:
commit
30ab3f1232
@ -54,7 +54,12 @@ func (g *GatewayAction) AddHTTPRule(req *apimodel.AddHTTPRuleStruct) (string, er
|
||||
ServiceID: req.ServiceID,
|
||||
ContainerPort: req.ContainerPort,
|
||||
Domain: req.Domain,
|
||||
Path: req.Path,
|
||||
Path: func() string {
|
||||
if !strings.HasPrefix(req.Path, "/") {
|
||||
return "/" + req.Path
|
||||
}
|
||||
return req.Path
|
||||
}(),
|
||||
Header: req.Header,
|
||||
Cookie: req.Cookie,
|
||||
Weight: req.Weight,
|
||||
@ -164,7 +169,12 @@ func (g *GatewayAction) UpdateHTTPRule(req *apimodel.UpdateHTTPRuleStruct) (stri
|
||||
if req.Domain != "" {
|
||||
rule.Domain = req.Domain
|
||||
}
|
||||
rule.Path = req.Path
|
||||
rule.Path = func() string {
|
||||
if !strings.HasPrefix(req.Path, "/") {
|
||||
return "/" + req.Path
|
||||
}
|
||||
return req.Path
|
||||
}()
|
||||
rule.Header = req.Header
|
||||
rule.Cookie = req.Cookie
|
||||
rule.Weight = req.Weight
|
||||
|
Loading…
Reference in New Issue
Block a user