From 84b562beb86ee69b83e91e5898c73eaa13b10b6e Mon Sep 17 00:00:00 2001
From: Jan Semmelink <jan@uafrica.com>
Date: Wed, 20 Oct 2021 11:24:23 +0200
Subject: [PATCH] Update API to return no content for handlers without a
 response

---
 api/lambda.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/api/lambda.go b/api/lambda.go
index b2aeaed..c36be3b 100644
--- a/api/lambda.go
+++ b/api/lambda.go
@@ -273,6 +273,10 @@ func (api Api) Handler(baseCtx context.Context, apiGatewayProxyReq events.APIGat
 		}
 		res.Headers["Content-Type"] = "application/json"
 		res.Body = string(bodyBytes)
+	} else {
+		//no content
+		delete(res.Headers, "Content-Type")
+		res.Body = ""
 	}
 	return
 }
-- 
GitLab