change should disregard ingress rules without specified location
This commit is contained in:
parent
98a9571da9
commit
571011d06d
|
@ -80,14 +80,16 @@ func (p *Proxy) ProxyHTTP(
|
||||||
}
|
}
|
||||||
p.logRequest(req, logFields)
|
p.logRequest(req, logFields)
|
||||||
|
|
||||||
fmt.Println(fmt.Sprintf("before: req.URL.Path: %s", req.URL.Path))
|
if rule.Location != "" {
|
||||||
parts := strings.Split(req.URL.Path, "/")
|
fmt.Println(fmt.Sprintf("before: req.URL.Path: %s", req.URL.Path))
|
||||||
fmt.Println("parts:", parts)
|
parts := strings.Split(req.URL.Path, "/")
|
||||||
if len(parts) > 1 {
|
fmt.Println("parts:", parts)
|
||||||
parts[1] = rule.Location
|
if len(parts) > 1 {
|
||||||
|
parts[1] = rule.Location
|
||||||
|
}
|
||||||
|
req.URL.Path = path.Clean(strings.Join(parts, "/"))
|
||||||
|
fmt.Println(fmt.Sprintf("after: req.URL.Path: %s", req.URL.Path))
|
||||||
}
|
}
|
||||||
req.URL.Path = path.Clean(strings.Join(parts, "/"))
|
|
||||||
fmt.Println(fmt.Sprintf("after: req.URL.Path: %s", req.URL.Path))
|
|
||||||
|
|
||||||
switch originProxy := rule.Service.(type) {
|
switch originProxy := rule.Service.(type) {
|
||||||
case ingress.HTTPOriginProxy:
|
case ingress.HTTPOriginProxy:
|
||||||
|
|
Loading…
Reference in New Issue