diff --git a/src/extensions/nginx-app-protect/nap/nap_metadata.go b/src/extensions/nginx-app-protect/nap/nap_metadata.go index c9e8f92a0..c1068fd4b 100644 --- a/src/extensions/nginx-app-protect/nap/nap_metadata.go +++ b/src/extensions/nginx-app-protect/nap/nap_metadata.go @@ -10,8 +10,8 @@ package nap import ( "encoding/json" "errors" - "os" "fmt" + "os" "path/filepath" "github.com/nginx/agent/sdk/v2" @@ -101,10 +101,10 @@ func UpdateMetadata( } log.Debugf("Writing NAP Metadata %s", m) - + err = os.WriteFile(appProtectWAFDetails.GetWafLocation(), m, 0o664) if err != nil { - return fmt.Errorf("failed to write NAP Metadata update: %v", err ) + return fmt.Errorf("failed to write NAP Metadata update: %v", err) } return nil diff --git a/src/extensions/nginx-app-protect/nap/nap_metadata_test.go b/src/extensions/nginx-app-protect/nap/nap_metadata_test.go index 2e0333ce9..7be283f2d 100644 --- a/src/extensions/nginx-app-protect/nap/nap_metadata_test.go +++ b/src/extensions/nginx-app-protect/nap/nap_metadata_test.go @@ -171,7 +171,7 @@ func TestUpdateNapMetadata(t *testing.T) { WafLocation: metadataFile, PrecompiledPublication: tc.precompPub, } - + ignoreDirectives = []string{} err = UpdateMetadata(cfg, appProtectWAFDetails, ignoreDirectives) diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go index c9e8f92a0..c1068fd4b 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/nap/nap_metadata.go @@ -10,8 +10,8 @@ package nap import ( "encoding/json" "errors" - "os" "fmt" + "os" "path/filepath" "github.com/nginx/agent/sdk/v2" @@ -101,10 +101,10 @@ func UpdateMetadata( } log.Debugf("Writing NAP Metadata %s", m) - + err = os.WriteFile(appProtectWAFDetails.GetWafLocation(), m, 0o664) if err != nil { - return fmt.Errorf("failed to write NAP Metadata update: %v", err ) + return fmt.Errorf("failed to write NAP Metadata update: %v", err) } return nil