|
@@ -29,7 +29,7 @@ func passAndLearn(resp *http.Response) error {
|
|
|
resp.Header.Set("Content-Encoding", "none")
|
|
|
log.Println("Filing inside bad class")
|
|
|
feedRequest(req, "BAD")
|
|
|
- ControPlane.StatsTokens <- "LEARN-BAD"
|
|
|
+ ControPlane.StatsTokens <- "DOWNGRADE"
|
|
|
default:
|
|
|
log.Println("Filing inside Good Class: ", resp.StatusCode)
|
|
|
feedRequest(req, "GOOD")
|
|
@@ -59,7 +59,7 @@ func blockAndlearn(resp *http.Response) error {
|
|
|
feedRequest(req, "BAD")
|
|
|
default:
|
|
|
log.Println("Filing inside Good Class: ", resp.StatusCode)
|
|
|
- ControPlane.StatsTokens <- "LEARN-GOOD"
|
|
|
+ ControPlane.StatsTokens <- "UPGRADED"
|
|
|
feedRequest(req, "GOOD")
|
|
|
}
|
|
|
|
|
@@ -69,7 +69,7 @@ func blockAndlearn(resp *http.Response) error {
|
|
|
|
|
|
func sanitizeHeaders(s string) string {
|
|
|
|
|
|
- re := regexp.MustCompile(`[[:alnum:]]{4,32}|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|([0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12})`)
|
|
|
+ re := regexp.MustCompile(`[[:alnum:]]{6,32}|[[:alpha:]]{4,32}|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|([0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12})`)
|
|
|
matched := re.FindAllString(s, -1)
|
|
|
|
|
|
uMatched := Unique(matched)
|