| 84 | } |
| 85 | |
| 86 | func (s *Server) sendSVG(svgContent string, w http.ResponseWriter) { |
| 87 | w.Header().Set("Content-Type", "image/svg+xml; charset=utf-8") |
| 88 | w.Header().Set("Cache-Control", "public, max-age=600") |
| 89 | w.Header().Set("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'") |
| 90 | w.WriteHeader(http.StatusOK) |
| 91 | |
| 92 | fmt.Fprintln(w, svgContent) |
| 93 | w.(http.Flusher).Flush() |
| 94 | } |
| 95 | |
| 96 | func (s *Server) handleSVGInBackground(r *http.Request, b *rod.Browser) { |
| 97 | log.Println("New SVG request in background.") |