diff --git a/pkg/apiutil/apiutil.go b/pkg/apiutil/apiutil.go index 83c2c3b75ec..025c9a6ebe1 100644 --- a/pkg/apiutil/apiutil.go +++ b/pkg/apiutil/apiutil.go @@ -139,7 +139,7 @@ func ErrorResp(rd *render.Render, w http.ResponseWriter, err error) { // GetComponentNameOnHTTP returns component name from Request Header func GetComponentNameOnHTTP(r *http.Request) string { componentName := r.Header.Get(componentSignatureKey) - if componentName == "" { + if len(componentName) == 0 { componentName = componentAnonymousValue } return componentName