sensitive icon indicating copy to clipboard operation
sensitive copied to clipboard

敏感词查找,验证,过滤和替换 🤓 FindAll, Validate, Filter and Replace words.

Results 8 sensitive issues
Sort by recently updated
recently updated
newest added

err := filter.LoadNetWordDict("https://raw.githubusercontent.com/importcjj/sensitive/master/dict/dict.txt") fmt.Println(err) 【Get "https://raw.githubusercontent.com/importcjj/sensitive/master/dict/dict.txt": dial tcp: lookup raw.githubusercontent.com: getaddrinfow: The requested name is valid, but no data of the requested type was found.】 请问这个问题如何解决?期待您的解答,谢谢!

修改了 LoadNetWordDict 方法: - 加上 HTTP 状态码状态码检查,要求小于400; - 增加参数 allowHtml ,简单检查一下 Content-Type 是否包含 html 。

使用 range 关键字, 将 `current.isPathEnd = true` 移到循环外, 避免判断.

* 使用两个 for 循环来更新该函数, 没有增加时间复杂度/空间复杂度, 但是更容易理解. * 使用短赋值语句来减少变量声明. * `left` 总小于等于 `position`, 故去掉判断.