(urlRules map[string]*URL)
| 679 | } |
| 680 | |
| 681 | func (c *RemoteConfig) applyURLRules(urlRules map[string]*URL) { |
| 682 | // save original urls |
| 683 | originalURLs := make([]string, len(c.URLs)) |
| 684 | copy(originalURLs, c.URLs) |
| 685 | |
| 686 | for i, url := range c.URLs { |
| 687 | if matchingURLRule := findLongestInsteadOfMatch(url, urlRules); matchingURLRule != nil { |
| 688 | c.URLs[i] = matchingURLRule.ApplyInsteadOf(c.URLs[i]) |
| 689 | c.insteadOfRulesApplied = true |
| 690 | } |
| 691 | } |
| 692 | |
| 693 | if c.insteadOfRulesApplied { |
| 694 | c.originalURLs = originalURLs |
| 695 | } |
| 696 | } |
no test coverage detected