-
Notifications
You must be signed in to change notification settings - Fork 434
fix(headers): add support for consistent * wildcard #1777
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
Conversation
|
If anyone has any suggestions regarding the PR label check, please let me know! I'm not sure what to do to clear that up - I thought the (also cc @lindsaylevine) |
a675380 to
7d3ab2d
Compare
|
this looks amazing @ctjlewis !!! the label thing has to be one of the |
7d3ab2d to
5011d32
Compare
|
This will currently match This "spec" is not well-worded nor detailed (no offense - I plan to send a PR to clarify the language once this is merged), and it only says:
I definitely knew we should take this to mean Without adjusting, Once we get clarification on this, this will be ready to finalize. |
|
Just tested: This version of The dev view finally loads and displays the content! |
erezrokah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ctjlewis, this is great work! Thank for the fix and those comments & tests look awesome 🚀
I'm going to look into our production logic to verify we're not missing anything here before I merge this.
|
Absolutely @erezrokah - if you can share any clarification you find on the production logic, I'd appreciate it. The Custom Headers documentation could use a teeny bit more context IMO (mostly just regarding the |
d675c6a to
ff78323
Compare
|
Hi @ctjlewis sorry for the delay. I added another commit for the headers parsing to make it more consistent with our production logic. I'll follow up on the headers matching as well. After finishing the latter I'll open an issue for our docs team to clarify https://docs.netlify.com/routing/headers/#syntax-for-the-headers-file. |
I also added some tests for The last changes use a regular expression instead of the previous approach - that's much closer to the production logic (it's not pretty though). |
39b32a1 to
b9c85f1
Compare
erezrokah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ctjlewis thanks again for helping us to clarify this.
I've opened a follow up issue to our docs team
eduardoboucas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great — thanks @ctjlewis! 🙌🏻
Super sorry for the delay in response! One note: Line 192 in 5166b97
I wonder if No idea, not just trying to make more work, just couldn't not notice it lol. |
Well it is matched by our prod logic: I'll add that use case to our docs issue, thanks! UpdateI missed read your comment.
|
Summary
The CLI's current behavior is to only allow the asterisk wildcard
*at the end of a rule. This PR aims to add support for wildcard which matches Netlify's deploy logic, which does not seem to have the same restriction.Test plan
Tests were updated in
headers.test.js. More robust testing should likely be added before merging.Changelog