nginxinc / nginx-go-crossplane

A library for working with NGINX configs in Go
Apache License 2.0
52 stars 14 forks source link

fix: validate body of types directive #43

Closed valyria257 closed 1 year ago

valyria257 commented 1 year ago

Proposed changes

types is a "map-like" directive meaning its body does not contain additional NGINX directives. Previously, if the body of the types directive was not empty, crossplane would fail to parse it because it did not recognize its contents as NGINX directives. This fixes this behavior by adding types to the set of map-like directives and validating only that each entry has the correct number of arguments, 1 or more.

For an example of the types directive, see http://nginx.org/en/docs/http/ngx_http_core_module.html#types.

Checklist

Before creating a PR, run through this checklist and mark each as complete.