diff --git a/micropub.go b/micropub.go index 3811a29..8e140ba 100644 --- a/micropub.go +++ b/micropub.go @@ -17,16 +17,10 @@ func HandleMicroPub(w http.ResponseWriter, r *http.Request) { if q := r.URL.Query().Get("q"); q == "config" || q == "syndicate-to" { w.Header().Add("Content-type", "application/json") w.WriteHeader(http.StatusOK) - jsonBytes, err := json.Marshal(&MicropubConfig{ + _ = json.NewEncoder(w).Encode(&MicropubConfig{ SyndicateTo: SyndicationTargets, MediaEndpoint: MediaEndpointUrl, }) - if err != nil { - w.WriteHeader(http.StatusBadRequest) - _, _ = w.Write([]byte(err.Error())) - return - } - _, _ = w.Write(jsonBytes) return } else { w.Header().Add("Content-type", "application/json")