ingress-nginx
ingress-nginx copied to clipboard
Allow any protocol for cors origins
What this PR does / why we need it:
Some applications which wrap browsers (like Tauri) use an origin such as tauri://localhost. Since the ingress-nginx regex only allows http[s] that means we can't easily enable cors for our tauri app.
This PR broadens the regex for the origin to allow any protocol. From my read, the regex that is generated for the nginx config should still correctly work with any protocol.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] CVE Report (Scanner found CVE and adding report)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation only
Which issue/s this PR fixes
How Has This Been Tested?
I've updated the tests to cover a case I'd like to see, and I'll be doing further testing in our environment soon.
Update: we've deployed this to production and it's been working as expected for us and fixes our Tauri cors issues.
Checklist:
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I've read the CONTRIBUTION guide
- [x] I have added unit and/or e2e tests to cover my changes.
- [x] All new and existing tests passed.
Welcome @iterion!
It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes/ingress-nginx has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @iterion. Thanks for your PR.
I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Deploy Preview for kubernetes-ingress-nginx ready!
| Name | Link |
|---|---|
| Latest commit | 728e48c1a26c086012b20e2c6a16c89baeaf3e8a |
| Latest deploy log | https://app.netlify.com/sites/kubernetes-ingress-nginx/deploys/66d323c4e8f0960008292cda |
| Deploy Preview | https://deploy-preview-11153--kubernetes-ingress-nginx.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
/ok-to-test /triage accepted /kind feature /priority backlog
@iterion can you check on the golint error and/or add an ignore statement
Done! I noticed elsewhere enableAnnotation is used for similar circumstances, so I just repeated that idiom here to fix the lint.
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev on Kubernetes Slack.
The lifecycle/frozen label can not be applied to PRs.
This bot removes lifecycle/frozen from PRs because:
- Commenting
/lifecycle frozenon a PR has not worked since March 2021 - PRs that remain open for >150 days are unlikely to be easily rebased
You can:
- Rebase this PR and attempt to get it merged
- Close this PR with
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/remove-lifecycle frozen
/lgtm Leaving for some other @kubernetes/ingress-nginx-maintainers to approve
/lgtm Thanks
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: iterion, rikatz
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [rikatz]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment