mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-10-26 11:27:18 +00:00
all: imp code
This commit is contained in:
parent
4215551bb3
commit
614879f2c8
@ -18,6 +18,10 @@ See also the [v0.107.66 GitHub milestone][ms-v0.107.66].
|
||||
NOTE: Add new changes BELOW THIS COMMENT.
|
||||
-->
|
||||
|
||||
### Changed
|
||||
|
||||
- Optimized matching of filtering rules.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Authentication errors in the Web UI when AdGuard Home is behind a proxy that sets Basic Auth headers ([#7987]).
|
||||
|
||||
@ -24,13 +24,13 @@ type IgnoreEngine struct {
|
||||
// NewIgnoreEngine creates a new instance of the IgnoreEngine and stores the
|
||||
// list of rules for ignoring hostnames.
|
||||
func NewIgnoreEngine(ignored []string) (e *IgnoreEngine, err error) {
|
||||
ruleList := []filterlist.Interface{
|
||||
ruleLists := []filterlist.Interface{
|
||||
filterlist.NewString(&filterlist.StringConfig{
|
||||
RulesText: strings.ToLower(strings.Join(ignored, "\n")),
|
||||
IgnoreCosmetic: true,
|
||||
}),
|
||||
}
|
||||
ruleStorage, err := filterlist.NewRuleStorage(ruleList)
|
||||
ruleStorage, err := filterlist.NewRuleStorage(ruleLists)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -796,9 +796,9 @@ func ruleListFromFilter(f Filter) (rl filterlist.Interface, skip bool, err error
|
||||
id := int(f.ID)
|
||||
|
||||
if len(f.Data) != 0 {
|
||||
return filterlist.NewString(&filterlist.StringConfig{
|
||||
return filterlist.NewBytes(&filterlist.BytesConfig{
|
||||
ID: id,
|
||||
RulesText: string(f.Data),
|
||||
RulesText: f.Data,
|
||||
IgnoreCosmetic: true,
|
||||
}), false, nil
|
||||
}
|
||||
@ -818,9 +818,9 @@ func ruleListFromFilter(f Filter) (rl filterlist.Interface, skip bool, err error
|
||||
return nil, false, fmt.Errorf("reading filter content: %w", err)
|
||||
}
|
||||
|
||||
return filterlist.NewString(&filterlist.StringConfig{
|
||||
return filterlist.NewBytes(&filterlist.BytesConfig{
|
||||
ID: id,
|
||||
RulesText: string(data),
|
||||
RulesText: data,
|
||||
IgnoreCosmetic: true,
|
||||
}), false, nil
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user