soft-serve icon indicating copy to clipboard operation
soft-serve copied to clipboard

fix: add CORS to config, improve test

Open fetsorn opened this issue 1 year ago • 6 comments

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

fetsorn avatar Feb 18 '25 14:02 fetsorn

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.

codecov[bot] avatar Feb 18 '25 14:02 codecov[bot]

Thank you for the changes @fetsorn! I will merge once the tests pass

aymanbagabas avatar Mar 12 '25 16:03 aymanbagabas

I also added several allowed headers needed for preflight requests

fetsorn avatar Mar 12 '25 17:03 fetsorn

readded the changes since they were reverted on main. all checks but lint pass, and lint fails outside cors

fetsorn avatar Mar 21 '25 06:03 fetsorn

Is merging this still blocked by something or just waiting in queue?

fetsorn avatar Mar 27 '25 14:03 fetsorn

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 🙂

aymanbagabas avatar Mar 27 '25 15:03 aymanbagabas

Just pinging this since v2 seems to have been merged, please do say if something has to change for this to go forward

fetsorn avatar Aug 05 '25 16:08 fetsorn

I rebased to main.

fetsorn avatar Oct 29 '25 05:10 fetsorn