diff --git a/swagger.go b/swagger.go index 5eb250d..ca1b55b 100644 --- a/swagger.go +++ b/swagger.go @@ -173,6 +173,7 @@ func Handler(configFns ...func(*Config)) http.HandlerFunc { switch path { case "index.html": + w.WriteHeader(http.StatusOK) _ = index.Execute(w, config) case "doc.json": doc, err := swag.ReadDoc(config.InstanceName) @@ -181,7 +182,7 @@ func Handler(configFns ...func(*Config)) http.HandlerFunc { return } - + w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(doc)) case "": http.Redirect(w, r, handler.Prefix+"index.html", http.StatusMovedPermanently)