MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / AddSubFilter

Method AddSubFilter

agent/utils/nginx/components/location.go:333–342  ·  view source on GitHub ↗
(subFilters map[string]string)

Source from the content-addressed store, hash-verified

331}
332
333func (l *Location) AddSubFilter(subFilters map[string]string) {
334 l.RemoveDirective("sub_filter", []string{})
335 l.Replaces = subFilters
336 for k, v := range subFilters {
337 l.UpdateDirective("sub_filter", []string{fmt.Sprintf(`"%s"`, k), fmt.Sprintf(`"%s"`, v)})
338 }
339 l.UpdateDirective("proxy_set_header", []string{"Accept-Encoding", `""`})
340 l.UpdateDirective("sub_filter_once", []string{"off"})
341 l.UpdateDirective("sub_filter_types", []string{"*"})
342}
343
344func (l *Location) RemoveSubFilter() {
345 l.RemoveDirective("sub_filter", []string{})

Callers 1

OperateProxyMethod · 0.95

Calls 2

RemoveDirectiveMethod · 0.95
UpdateDirectiveMethod · 0.95

Tested by

no test coverage detected