Explorar o código

In Server set headers to disable any caching.

Dmitry Chestnykh %!s(int64=10) %!d(string=hai) anos
pai
achega
3eb958d77b
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      server.go

+ 3 - 0
server.go

@@ -43,6 +43,9 @@ func Server(imgWidth, imgHeight int) http.Handler {
 }
 
 func (h *captchaHandler) serve(w http.ResponseWriter, id, ext string, lang string, download bool) error {
+	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
+	w.Header().Set("Pragma", "no-cache")
+	w.Header().Set("Expires", "0")
 	if download {
 		w.Header().Set("Content-Type", "application/octet-stream")
 	}