@@ -24,10 +24,10 @@ type CustomRouter struct {
24
24
25
25
type CustomHandlerFunc func (w http.ResponseWriter , req * http.Request , flw * flow.Flow , store * datastore.Datastore )
26
26
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 {
28
28
customRouter := & CustomRouter {}
29
29
r := bone .New ()
30
- r .CaseSensitive = false
30
+ r .CaseSensitive = caseSensitive
31
31
customRouter .Mux = r
32
32
customRouter .Store = s
33
33
customRouter .Key = key
@@ -37,7 +37,7 @@ func New(renderer *render.Render, s *datastore.Datastore, key security.Key) *Cus
37
37
}
38
38
39
39
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 )
41
41
customRouter .AuthHandler = authFn
42
42
return customRouter
43
43
}
@@ -55,6 +55,7 @@ func (customRouter *CustomRouter) GET(route string, routeFunc CustomHandlerFunc,
55
55
56
56
// POST - Post handler
57
57
func (customRouter * CustomRouter ) POST (route string , routeFunc CustomHandlerFunc , securityType string ) * bone.Route {
58
+
58
59
//route = strings.ToLower(route)
59
60
return customRouter .Mux .PostFunc (route , customRouter .handler ("POST" , routeFunc , securityType ))
60
61
}
@@ -98,6 +99,7 @@ func (customRouter *CustomRouter) DEL(route string, routeFunc CustomHandlerFunc,
98
99
func (customRouter * CustomRouter ) handler (reqType string , fn CustomHandlerFunc , authMethod string ) http.HandlerFunc {
99
100
return func (w http.ResponseWriter , req * http.Request ) {
100
101
flow := flow .New (w , req , customRouter .Renderer , customRouter .Store , customRouter .Key )
102
+ req .ParseForm ()
101
103
customRouter .AuthHandler (w , req , flow , customRouter .Store , fn , authMethod )
102
104
}
103
105
}
0 commit comments