From 059ffa95d9afe2da4324f277d7340d9e593ac778 Mon Sep 17 00:00:00 2001 From: ToTu-Dev <75479355+ToTu-Dev@users.noreply.github.com> Date: Sat, 12 Feb 2022 10:24:21 +0530 Subject: [PATCH] chore: bump minima methods --- cors.go | 2 +- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cors.go b/cors.go index 31d4f5b..c4c0792 100644 --- a/cors.go +++ b/cors.go @@ -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() } diff --git a/go.mod b/go.mod index d56153e..71d19ca 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 7209748..b0f4c61 100644 --- a/go.sum +++ b/go.sum @@ -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=