diff --git a/pkg/server/handlers.go b/pkg/server/handlers.go index 3cf04e4..3e8e667 100644 --- a/pkg/server/handlers.go +++ b/pkg/server/handlers.go @@ -7,6 +7,8 @@ import ( func stringHandler(content *string, mimeType string) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Cache-Control", "public, max-age=15") w.Header().Set("Content-Type", mimeType) w.Write([]byte(*content)) }) @@ -14,6 +16,8 @@ func stringHandler(content *string, mimeType string) http.Handler { func jsonMarshalHandler(content interface{}) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Cache-Control", "public, max-age=15") w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(content) })