gin-contrib / cors

Official CORS gin's middleware
https://gin-gonic.github.io/gin/
MIT License
1.77k stars 181 forks source link

Add domain wildcard #44

Closed groovili closed 5 years ago

groovili commented 6 years ago

At the moment only full wildcard is allowed *. By this change I want to add domain wildcard like *.some-domain.com, https://api.*.sub-domain.com, http://some-domain.* Per origin only one * passes validation.

groovili commented 6 years ago

@appleboy Would be awesome if there is any chance that you can take a look at this PR.

appleboy commented 5 years ago

@groovili conflicts.

codecov-io commented 5 years ago

Codecov Report

Merging #44 into master will increase coverage by 0.09%. The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage    92.8%   92.89%   +0.09%     
==========================================
  Files           3        3              
  Lines         139      169      +30     
==========================================
+ Hits          129      157      +28     
- Misses         10       11       +1     
- Partials        0        1       +1
Impacted Files Coverage Δ
config.go 100% <100%> (ø) :arrow_up:
cors.go 80.64% <90%> (+3.37%) :arrow_up:

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 214f318...826c199. Read the comment docs.

groovili commented 5 years ago

@appleboy resolved

groovili commented 5 years ago

@appleboy can you take a look?

appleboy commented 5 years ago

Please reformat the source code using gofmt command.

groovili commented 5 years ago

@appleboy thanks, done

appleboy commented 5 years ago

@thinkerou Need your approval.

thinkerou commented 5 years ago

Hi @groovili please see my review, you should fix it, thanks!

groovili commented 5 years ago

Hello, @thinkerou, thanks for the review. Issues resolved.

thinkerou commented 5 years ago

merged, thanks @groovili