From 107c13478200a344517ed88343a45a09c4b7b972 Mon Sep 17 00:00:00 2001 From: Matrix-X Date: Wed, 1 Jan 2025 16:40:53 +0800 Subject: [PATCH] Revert "fix(kernel): call Server.Serve nil pointer fixed" --- src/kernel/serverGuard.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/kernel/serverGuard.go b/src/kernel/serverGuard.go index bd60a211..4e81a63d 100644 --- a/src/kernel/serverGuard.go +++ b/src/kernel/serverGuard.go @@ -139,9 +139,7 @@ func (serverGuard *ServerGuard) Serve(request *http.Request) (response *http.Res response, err = validatedGuard.Resolve(request) - if response != nil { - logger.Info("Server response created:", "content", response.ContentLength) - } + logger.Info("Server response created:", "content", response.ContentLength) return response, err } @@ -436,7 +434,7 @@ func (serverGuard *ServerGuard) ParseMessage(content string, dataType string) (c callback = &models.Callback{} if len(content) <= 0 { - return callback, nil + return nil, errors.New("request body is empty") } if dataType == messages.DataTypeXML {