fix: add CORS to config, improve test
Hotfix for #516, I've corrected the test case and added CORS to the default config.
- [x] prepend c.HTTP.PublicURL to c.HTTP.CORS.AllowedOrigins in the Config.Validate() function.
- [x] make the testscript case more readable
- [x] hint a custom allowed origin in the config
- [x] enable PUT and OPTIONS in default config
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 52.91%. Comparing base (b06b555) to head (ff31e03).
:warning: Report is 227 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #654 +/- ##
==========================================
+ Coverage 51.96% 52.91% +0.95%
==========================================
Files 157 160 +3
Lines 13454 11599 -1855
==========================================
- Hits 6991 6138 -853
+ Misses 5891 4888 -1003
- Partials 572 573 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Thank you for the changes @fetsorn! I will merge once the tests pass
I also added several allowed headers needed for preflight requests
readded the changes since they were reverted on main. all checks but lint pass, and lint fails outside cors
Is merging this still blocked by something or just waiting in queue?
Is merging this still blocked by something or just waiting in queue?
Hi @fetsorn! Thank you again for working on this major feature. Sorry for the delay, but I've been working on https://github.com/charmbracelet/soft-serve/pull/678 and trying to get Soft Serve to use the new v2 stack. I thought CORS is a good feature to pair with v2 in the next release. Once I get #678 merged, very soon, I will merge this one and push a new v0.9.0 Soft Serve release 🙂
Just pinging this since v2 seems to have been merged, please do say if something has to change for this to go forward
I rebased to main.