Browse Source

Set `Content-Security-Policy` tag when the `raw` option is used

DarthSim 2 years ago
parent
commit
70d657113e
1 changed files with 1 additions and 0 deletions
  1. 1 0
      stream.go

+ 1 - 0
stream.go

@@ -118,6 +118,7 @@ func streamOriginImage(ctx context.Context, reqID string, r *http.Request, rw ht
 		"Expires":       rw.Header().Get("Expires"),
 		"Expires":       rw.Header().Get("Expires"),
 	})
 	})
 	setCanonical(rw, imageURL)
 	setCanonical(rw, imageURL)
+	rw.Header().Set("Content-Security-Policy", "script-src 'none'")
 
 
 	rw.WriteHeader(res.StatusCode)
 	rw.WriteHeader(res.StatusCode)