Skip to content

Commit be38368

Browse files
committed
case sensitive flag
1 parent 9095d8d commit be38368

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

router.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ type CustomRouter struct {
2424

2525
type CustomHandlerFunc func(w http.ResponseWriter, req *http.Request, flw *flow.Flow, store *datastore.Datastore)
2626

27-
func New(renderer *render.Render, s *datastore.Datastore, key security.Key) *CustomRouter {
27+
func New(renderer *render.Render, s *datastore.Datastore, key security.Key, caseSensitive bool) *CustomRouter {
2828
customRouter := &CustomRouter{}
2929
r := bone.New()
30-
r.CaseSensitive = false
30+
r.CaseSensitive = caseSensitive
3131
customRouter.Mux = r
3232
customRouter.Store = s
3333
customRouter.Key = key
@@ -37,7 +37,7 @@ func New(renderer *render.Render, s *datastore.Datastore, key security.Key) *Cus
3737
}
3838

3939
func CustomAuth(renderer *render.Render, s *datastore.Datastore, key security.Key, authFn func(w http.ResponseWriter, req *http.Request, flw *flow.Flow, store *datastore.Datastore, fn CustomHandlerFunc, authMethod string)) *CustomRouter {
40-
customRouter := New(renderer, s, key)
40+
customRouter := New(renderer, s, key, true)
4141
customRouter.AuthHandler = authFn
4242
return customRouter
4343
}
@@ -55,6 +55,7 @@ func (customRouter *CustomRouter) GET(route string, routeFunc CustomHandlerFunc,
5555

5656
// POST - Post handler
5757
func (customRouter *CustomRouter) POST(route string, routeFunc CustomHandlerFunc, securityType string) *bone.Route {
58+
5859
//route = strings.ToLower(route)
5960
return customRouter.Mux.PostFunc(route, customRouter.handler("POST", routeFunc, securityType))
6061
}
@@ -98,6 +99,7 @@ func (customRouter *CustomRouter) DEL(route string, routeFunc CustomHandlerFunc,
9899
func (customRouter *CustomRouter) handler(reqType string, fn CustomHandlerFunc, authMethod string) http.HandlerFunc {
99100
return func(w http.ResponseWriter, req *http.Request) {
100101
flow := flow.New(w, req, customRouter.Renderer, customRouter.Store, customRouter.Key)
102+
req.ParseForm()
101103
customRouter.AuthHandler(w, req, flow, customRouter.Store, fn, authMethod)
102104
}
103105
}

0 commit comments

Comments
 (0)