feat!: correctly interpret /**/*
paths
#440
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This came up over in this forums post: https://answers.netlify.com/t/please-clarify-documentation-for-edge-functions-excludedpath/97443
Given the path
/**/*.html
, i'd expect it to match both/foo.html
and/sub/foo.html
. With our current handling, only/sub/foo.html
is matched however - i've demonstrated this in a test added in the first commit of this PR.After reading into this, it turns out that the special meaning of
**
was introduced "recently" in 2010 and is calledglobstar
. We don't have it enabled for edge functions currently, which means that/**/*.html
is equivalent to/*/*.html
. This probably comes at a surprise to our customers.This PR enables the globstar option. This is a breaking change to what we implemented, and i'm unsure what's the best way of rolling this out. Here's a matrix for how it'd change behaviour:
globstar
/*.html
/foo.html
,/sub/foo.html
/foo.html
/**/*.html
/sub/foo.html
/foo.html
,/sub/foo.html
This would essentially break sites that have an edge function at
/*
, so i'm really unsure if this is a change we can make now 🤔 Let's have a discussion on that.