Skip to content

Commit

Permalink
Fix tempalte-id validation
Browse files Browse the repository at this point in the history
  • Loading branch information
RamanaReddy0M committed Jun 4, 2024
1 parent 5428d05 commit 49ad3c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ func (template *Template) UnmarshalYAML(unmarshal func(interface{}) error) error
}
*template = Template(*alias)

if !ReTemplateID.MatchString(template.ID) {
return errorutil.New("template id must match expression %v", ReTemplateID).WithTag("invalid template")
}

if len(template.RequestsHTTP) > 0 || len(template.RequestsNetwork) > 0 {
_ = deprecatedProtocolNameTemplates.Set(template.ID, true)
}
Expand Down

0 comments on commit 49ad3c4

Please sign in to comment.