clean-up middleware

This commit is contained in:
Lars Hoogestraat 2020-12-06 16:07:53 +01:00
parent aca7f56fa2
commit 144cc03e91
1 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ func (fn XMLHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
if err != nil {
logger.Log.Error(err)
xml, err := xml.Marshal(err)
x, err := xml.Marshal(err)
if err != nil {
logger.Log.Error(err)
@ -34,14 +34,14 @@ func (fn XMLHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
return
}
rw.Write(xml)
rw.Write(x)
return
}
x, err := xml.MarshalIndent(h.Data, "", "\t")
x, err2 := xml.MarshalIndent(h.Data, "", "\t")
if err != nil {
http.Error(rw, err.Error(), http.StatusInternalServerError)
if err2 != nil {
http.Error(rw, err2.Error(), http.StatusInternalServerError)
return
}