From e50dd96a3420aa0d558e2004aecf8e822767e83a Mon Sep 17 00:00:00 2001 From: MohitKatare-protean Date: Wed, 9 Apr 2025 08:21:32 +0530 Subject: [PATCH] Update reqpreprocessor.go --- pkg/plugin/implementation/reqpreprocessor/reqpreprocessor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/plugin/implementation/reqpreprocessor/reqpreprocessor.go b/pkg/plugin/implementation/reqpreprocessor/reqpreprocessor.go index 72f1a28..7ca2901 100644 --- a/pkg/plugin/implementation/reqpreprocessor/reqpreprocessor.go +++ b/pkg/plugin/implementation/reqpreprocessor/reqpreprocessor.go @@ -19,7 +19,7 @@ type Config struct { ContextKeys []string } -const contextKeyField = "context" +const contextKey = "context" // NewPreProcessor returns a middleware that processes the incoming request, // extracts the context field from the body, and adds relevant values (like subscriber ID). @@ -44,7 +44,7 @@ func NewPreProcessor(cfg *Config) (func(http.Handler) http.Handler, error) { // Extract context from request. reqContext, ok := req["context"].(map[string]interface{}) if !ok { - http.Error(w, fmt.Sprintf("%s field not found or invalid.", contextKeyField), http.StatusBadRequest) + http.Error(w, fmt.Sprintf("%s field not found or invalid.", contextKey), http.StatusBadRequest) return } var subID any