From 615cba85b3f21f55c46d0ec642c2a06f50f24758 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= <mordae@anilinux.org>
Date: Sat, 15 May 2021 22:54:12 +0200
Subject: [PATCH] Do not repeat status line in defaultHandler
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Instead of repeating the status line in the defaultHandler for every
exception, repeat it only when the message is empty.

Signed-off-by: Jan Hamal Dvořák <mordae@anilinux.org>
---
 lib/Hikaru/Types.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Hikaru/Types.hs b/lib/Hikaru/Types.hs
index 8394f9a..b407e98 100644
--- a/lib/Hikaru/Types.hs
+++ b/lib/Hikaru/Types.hs
@@ -312,7 +312,7 @@ where
 
     where
       response st = resp . responseLBS st [(hContentType, "text/plain")]
-                         . cs . (<> "\n" <> msg)
+                         . cs . (\str -> if msg == "" then str else msg)
 
 
   -- |
-- 
GitLab