Skip to content

Commit

Permalink
Merge pull request #144 from nginx/fix-metadata-nap-version
Browse files Browse the repository at this point in the history
fix: check if app_protect_metadata's nap version is empty first.
  • Loading branch information
yluf5 authored Dec 9, 2022
2 parents d78f841 + 6f4c2b1 commit 5384bb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (n *Nginx) applyConfig(cmd *proto.Command, cfg *proto.Command_NginxConfig)
status.NginxConfigResponse.Status = newErrStatus(fmt.Sprintf("Config apply failed (preflight): not able to read WAF file in metadata %v", config.GetConfigData())).CmdStatus
return status
}
if n.wafVersion != napMetaData.NapVersion {
if napMetaData.NapVersion != "" && n.wafVersion != napMetaData.NapVersion {
status.NginxConfigResponse.Status = newErrStatus(fmt.Sprintf("Config apply failed (preflight): config metadata mismatch %v", config.GetConfigData())).CmdStatus
return status
}
Expand Down

0 comments on commit 5384bb8

Please sign in to comment.