Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@xXxsomebodyoncetoldmexXx
Copy link
Contributor

Hello again, just add some support for wildcard exclude domain. Let me know if it need any changes.

@zema1
Copy link
Owner

zema1 commented Jul 11, 2024

Thanks for your commit!
I believe that using glob for the implementation of wildcards is more suitable, as glob is designed for this purpose. The current implementation for ExcludeDomain is little redundant and complex. I prefer just define as ExcludeDomainGlob []glob.Glob , and check it like

for _, g := range m.config.ExcludeDomainGlob {
	if g.Match("xxxx", g) {
		// should exclude this domain
		return true
	}
}
return false

Also, ExcludeDomainGlob should be compiled first according to the user config.

zema1 added a commit that referenced this pull request Aug 27, 2024
@zema1
Copy link
Owner

zema1 commented Aug 27, 2024

You can simply use wildcard for exclude domain now, for example

*.mozilla.net
*.mozilla.com
*.mozilla.org
*.firefox.com
*.google*.com

@zema1 zema1 closed this Aug 27, 2024
zema1 added a commit that referenced this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants