Browse Source

No cache on error response.

Loweel 4 years ago
parent
commit
a22c8c977b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      classifier.go

+ 2 - 0
classifier.go

@@ -36,6 +36,7 @@ func passAndLearn(resp *http.Response) error {
 		resp.StatusCode = 403
 		resp.Header["Content-Length"] = []string{fmt.Sprint(buf.Len())}
 		resp.Header.Set("Content-Encoding", "none")
+		resp.Header.Set("Cache-Control", "no-cache, no-store")
 		log.Println("Filing inside bad class")
 		feedRequest(req, "BAD")
 		ControPlane.StatsTokens <- "DOWNGRADE"
@@ -59,6 +60,7 @@ func blockAndlearn(resp *http.Response) error {
 	resp.StatusCode = 403
 	resp.Header["Content-Length"] = []string{fmt.Sprint(buf.Len())}
 	resp.Header.Set("Content-Encoding", "none")
+	resp.Header.Set("Cache-Control", "no-cache, no-store")
 
 	switch {
 	case isAuth(resp):