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

Don't modify the config in Validate #71

Conversation

lantw44
Copy link
Contributor

@lantw44 lantw44 commented Sep 24, 2020

Instead of processing '*' and changing the configuration passed into
Validate, which can break the configuration and cause unexpected panics,
process it in newCors so the modification only exists in the internal
copy of the configuration.

Fixes #70

Instead of processing '*' and changing the configuration passed into
Validate, which can break the configuration and cause unexpected panics,
process it in newCors so the modification only exists in the internal
copy of the configuration.

Fixes gin-contrib#70
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2020

Codecov Report

Merging #71 into master will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
- Coverage   93.02%   92.95%   -0.07%     
==========================================
  Files           3        3              
  Lines         172      142      -30     
==========================================
- Hits          160      132      -28     
+ Misses         11        9       -2     
  Partials        1        1              
Impacted Files Coverage Δ
config.go 100.00% <100.00%> (ø)
cors.go 79.59% <100.00%> (-1.95%) ⬇️
utils.go 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88812e7...7498250. Read the comment docs.

@lantw44
Copy link
Contributor Author

lantw44 commented Oct 12, 2020

Ping!

@lantw44
Copy link
Contributor Author

lantw44 commented Oct 23, 2020

Ping again.

@lantw44
Copy link
Contributor Author

lantw44 commented Nov 4, 2020

PING!

@appleboy appleboy merged commit 8c02baa into gin-contrib:master Nov 4, 2020
@appleboy
Copy link
Member

appleboy commented Nov 4, 2020

@lantw44 Thanks.

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.

config.Validate modifies the config itself
3 participants