MCPcopy Create free account
hub / github.com/ez4o/github-contribution-graph / sendSVG

Method sendSVG

src/server/server.go:86–94  ·  view source on GitHub ↗
(svgContent string, w http.ResponseWriter)

Source from the content-addressed store, hash-verified

84}
85
86func (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
96func (s *Server) handleSVGInBackground(r *http.Request, b *rod.Browser) {
97 log.Println("New SVG request in background.")

Callers 1

handleSVGMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected