Skip to content
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

add CORS to rest server and config #550

Merged
merged 9 commits into from
Sep 5, 2022
Merged

Conversation

NMathar
Copy link
Contributor

@NMathar NMathar commented Sep 2, 2022

i have to add it because my frontend gave me some CORS errors. Feel free for some tests and let me know if i have something to change.

@codecov
Copy link

codecov bot commented Sep 2, 2022

Codecov Report

Merging #550 (cb06499) into master (55754dd) will decrease coverage by 0.21%.
The diff coverage is 47.61%.

@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
- Coverage   71.42%   71.21%   -0.22%     
==========================================
  Files          62       62              
  Lines       11659    11765     +106     
==========================================
+ Hits         8327     8378      +51     
- Misses       2543     2585      +42     
- Partials      789      802      +13     
Impacted Files Coverage Δ
server/rest.go 74.15% <0.00%> (-0.62%) ⬇️
config/config.go 84.42% <100.00%> (+0.21%) ⬆️
master/rest.go 53.46% <0.00%> (-2.09%) ⬇️
storage/cache/redis.go 86.61% <0.00%> (-1.57%) ⬇️
storage/cache/sql.go 79.09% <0.00%> (-0.26%) ⬇️
storage/data/sql.go 78.88% <0.00%> (-0.18%) ⬇️
storage/cache/mongodb.go 77.65% <0.00%> (-0.09%) ⬇️
storage/data/mongodb.go 79.49% <0.00%> (-0.08%) ⬇️
storage/data/database.go 64.54% <0.00%> (ø)
storage/data/no_database.go 100.00% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@zhenghaoz zhenghaoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. There is some comments. 😄

config/config.go Outdated Show resolved Hide resolved
config/config.go Show resolved Hide resolved
server/rest.go Outdated Show resolved Hide resolved
server/rest.go Outdated Show resolved Hide resolved
config/config.toml.template Outdated Show resolved Hide resolved
server/rest.go Outdated Show resolved Hide resolved
@NMathar
Copy link
Contributor Author

NMathar commented Sep 5, 2022

thanks for your input. i hope my changes works for you.

config/config_test.go Outdated Show resolved Hide resolved
server/rest.go Outdated Show resolved Hide resolved
@zhenghaoz
Copy link
Collaborator

thanks for your input. i hope my changes works for you.

thanks for your response. maybe a little bit change is needed 😃

@NMathar
Copy link
Contributor Author

NMathar commented Sep 5, 2022

no problem i learn a lot in go now ^^

@zhenghaoz zhenghaoz merged commit 92e2404 into gorse-io:master Sep 5, 2022
zap.String("url", fmt.Sprintf("http://%s:%d", s.HttpHost, s.HttpPort)))
zap.String("url", fmt.Sprintf("http://%s:%d", s.HttpHost, s.HttpPort)),
zap.Strings("cors_methods", s.Config.Master.HttpCorsMethods),
zap.Strings("cors_doamins", s.Config.Master.HttpCorsDomains),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Domains*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants