From 46d55016f0048c2a29eac6bd347b947430488d6e Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Tue, 10 Apr 2018 18:03:35 +0200 Subject: [PATCH] moving withConverter call up --- app/handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/handlers.go b/app/handlers.go index 3a2e7fbc..c63db562 100644 --- a/app/handlers.go +++ b/app/handlers.go @@ -62,10 +62,11 @@ func convertHandler(next http.Handler) http.Handler { if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) logger.Error(err) - cleanup(r) return } + r = context.WithConverter(r, c) + path, err := c.Convert() if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) @@ -74,7 +75,6 @@ func convertHandler(next http.Handler) http.Handler { return } - r = context.WithConverter(r, c) r = context.WithResultFilePath(r, path) next.ServeHTTP(w, r)