nginxinc / nginx-go-crossplane

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

fix: allow 'include' directive in 'if' and 'limit_except' blocks #74

Closed dareste closed 10 months ago

dareste commented 10 months ago

Proposed changes

Resolves #72.

The mask ngxAnyConf is defined as "any context except server > if, location > if and location > limit_except".

Given that this mask is only used for defining the valid contexts for the include directive, and given that the contexts listed above are valid for include, it makes sense to modify the ngxAnyConf definition to include such contexts.

Checklist

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

ornj commented 10 months ago

I don't know why the original definition of this mask omitted if contexts and limit_except. This went all the way back to the original Python without a useful commit message or hint as to why it was implemented this way.