(path string)
| 51 | } |
| 52 | |
| 53 | func (r *HeaderRule) match(path string) (match bool) { |
| 54 | if len(r.Include) > 0 { |
| 55 | for _, item := range r.Include { |
| 56 | if strings.Contains(path, item) { |
| 57 | match = true |
| 58 | } |
| 59 | } |
| 60 | } else { |
| 61 | match = true |
| 62 | } |
| 63 | for _, item := range r.Exclude { |
| 64 | if strings.Contains(path, item) { |
| 65 | return false |
| 66 | } |
| 67 | } |
| 68 | return |
| 69 | } |
| 70 | |
| 71 | // HeaderConfig is the format of the header configuration file. |
| 72 | type HeaderConfig struct { |