From 131d99a182b284179308bc28d6050bb7fe194fe8 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Sat, 29 Feb 2020 16:40:54 +0300 Subject: [PATCH] fix content-type detection --- receive.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/receive.go b/receive.go index 9b89cad..a3d001b 100644 --- a/receive.go +++ b/receive.go @@ -138,7 +138,9 @@ func receiveObject(c *fasthttp.RequestCtx, cli object.Service_GetClient) error { } } - typ = http.DetectContentType(obj.Payload) + if len(obj.Payload) > 0 { + typ = http.DetectContentType(obj.Payload) + } if _, err = c.Write(obj.Payload); err != nil { return err