gin-contrib / cors

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

Fix detection of same origin #61

Closed ReneGa closed 4 years ago

ReneGa commented 4 years ago

For incoming requests, the Host header is promoted to the Request.Host field and removed from the Header map.

Therefore, it is Request.Host that needs to be compared against the origin of a request.

Fixes: #60

codecov-io commented 4 years ago

Codecov Report

Merging #61 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #61   +/-   ##
=======================================
  Coverage   93.02%   93.02%           
=======================================
  Files           3        3           
  Lines         172      172           
=======================================
  Hits          160      160           
  Misses         11       11           
  Partials        1        1
Impacted Files Coverage Δ
config.go 100% <100%> (ø) :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 3b3fe50...17379b5. Read the comment docs.

helei112g commented 4 years ago

Can we prioritize this