Skip to content

Commit

Permalink
Merge pull request #3 from gominima/bump-methods
Browse files Browse the repository at this point in the history
chore: bump minima methods
  • Loading branch information
apoorvcodes authored Feb 12, 2022
2 parents 3b0e4d6 + 059ffa9 commit ac8ce03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func New() *corsWrapper {
func (c *corsWrapper) Build() minima.Handler {
return func(res *minima.Response, req *minima.Request) {
c.HandlerFunc(res.Raw(), req.Raw())
if !c.optionPassthrough && req.Method() == http.MethodOptions && req.Header().Get("Access-Control-Request-Method") != "" {
if !c.optionPassthrough && req.Method() == http.MethodOptions && req.GetHeader("Access-Control-Request-Method") != "" {
res.OK()
res.CloseConn()
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/gominima/cors
go 1.17

require (
github.com/gominima/minima v0.1.2-alpha.0.20220207142511-7e3d93afcb00 // indirect
github.com/gominima/minima v0.1.2-alpha.0.20220212044950-054e20ca2c72 // indirect
github.com/rs/cors v1.8.2 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ github.com/gominima/minima v0.1.2-alpha h1:bkF+6ov/RrSebS6UQlO2FZqwzUVLcqFbxoC2R
github.com/gominima/minima v0.1.2-alpha/go.mod h1:cK4qIs4pa3puqyRlWrHS5ThQpPUDFz4p+u5WuEEC7HQ=
github.com/gominima/minima v0.1.2-alpha.0.20220207142511-7e3d93afcb00 h1:3w3bNtI97sLyT5kx856NHVE2EYsRCL2eNTAbrnQ7Yd4=
github.com/gominima/minima v0.1.2-alpha.0.20220207142511-7e3d93afcb00/go.mod h1:P5UfLGNw2HbXoGrP0MOavT5mxfpMfZZHbhwCsTy257c=
github.com/gominima/minima v0.1.2-alpha.0.20220212044950-054e20ca2c72 h1:CMtzoJb3WxDZ8X7ZlFpJTC1xdalSRG5uIZX2F1aXExo=
github.com/gominima/minima v0.1.2-alpha.0.20220212044950-054e20ca2c72/go.mod h1:P5UfLGNw2HbXoGrP0MOavT5mxfpMfZZHbhwCsTy257c=
github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=

0 comments on commit ac8ce03

Please sign in to comment.