Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-parity wildcard/globbing behavior on include #64

Open
nf-brentsaner opened this issue Feb 11, 2025 · 0 comments
Open

Non-parity wildcard/globbing behavior on include #64

nf-brentsaner opened this issue Feb 11, 2025 · 0 comments

Comments

@nf-brentsaner
Copy link

When NGINX encounters an include foo/* directive, it does NOT include hidden files in the globbed match.

However, a *(github.com/tufanbarisyildirim/gonginx/parser.Parser).Parse() with a parser.Optiion of parser.WithIncludeParsing() does include hidden files if that include directive uses wildcards/globs.

This has led to a particularly confusing bug for us, as nginx -t validates but the parsing would fail consistently. :)

If include parsing is enabled, I'd filter the globbed list and filter each item out of it matches an if strings.HasPrefix(filepath.Base(fname), ".") (where fname is the filename/filepath, and filepath is stdlib's path/filepath).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant