From 56cb81bbb4f6e1c85c593382ddd3dccd99a054e7 Mon Sep 17 00:00:00 2001 From: Evan Buss Date: Sat, 13 Jul 2024 20:52:29 +0000 Subject: [PATCH] fix: return after handleError --- server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.go b/server.go index eda3026..a28adf9 100644 --- a/server.go +++ b/server.go @@ -124,6 +124,7 @@ func handleFeed(outputDir string, feeds []FeedConfig, s *securecookie.SecureCook mimeType, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { handleError(r, w, "Failed to parse content type", err) + return } if mimeType == ATOM_MIME { @@ -159,6 +160,7 @@ func handleFeed(outputDir string, feeds []FeedConfig, s *securecookie.SecureCook filename, err := parseFileName(resp) if err != nil { handleError(r, w, "Failed to parse file name", err) + return } epubFile := filepath.Join(outputDir, filename) @@ -168,10 +170,12 @@ func handleFeed(outputDir string, feeds []FeedConfig, s *securecookie.SecureCook outputFile, err := converter.Convert(epubFile) if err != nil { handleError(r, w, "Failed to convert epub", err) + return } if err = sendConvertedFile(w, outputFile); err != nil { handleError(r, w, "Failed to send converted file", err) + return } } }