feat: 反向代理文本替换增加 sub_filter_types 参数 (#6661)

Refs https://github.com/1Panel-dev/1Panel/issues/6490
This commit is contained in:
zhengkunwang 2024-10-09 15:02:56 +08:00 committed by GitHub
parent e069db3c45
commit b091c7f364
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -234,11 +234,13 @@ func (l *Location) AddSubFilter(subFilters map[string]string) {
} }
l.UpdateDirective("proxy_set_header", []string{"Accept-Encoding", `""`}) l.UpdateDirective("proxy_set_header", []string{"Accept-Encoding", `""`})
l.UpdateDirective("sub_filter_once", []string{"off"}) l.UpdateDirective("sub_filter_once", []string{"off"})
l.UpdateDirective("sub_filter_types", []string{"*"})
} }
func (l *Location) RemoveSubFilter() { func (l *Location) RemoveSubFilter() {
l.RemoveDirective("sub_filter", []string{}) l.RemoveDirective("sub_filter", []string{})
l.RemoveDirective("proxy_set_header", []string{"Accept-Encoding", `""`}) l.RemoveDirective("proxy_set_header", []string{"Accept-Encoding", `""`})
l.RemoveDirective("sub_filter_once", []string{"off"}) l.RemoveDirective("sub_filter_once", []string{"off"})
l.RemoveDirective("sub_filter_types", []string{"*"})
l.Replaces = nil l.Replaces = nil
} }