File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,9 @@ module.exports = (sails: Sails.Sails): Sails.Hook<SwaggerGenerator> => {
37
37
initialize : function ( next ) : void {
38
38
39
39
// https://github.com/balderdashy/sails/blob/master/lib/EVENTS.md#routerbind
40
- sails . on ( 'router:bind' , ( routeObj ) => {
41
- if ( ! routes . find ( route => route . path === routeObj . path && route . verb === routeObj . verb ) ) {
40
+ sails . on ( 'router:bind' , routeObj => {
41
+ if ( ! routes . find ( route => route . path === routeObj . path && route . verb === routeObj . verb . toLowerCase ( ) ) ) {
42
+ routeObj . verb = routeObj . verb . toLowerCase ( ) ;
42
43
routes . push ( routeObj ) ;
43
44
}
44
45
} ) ;
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ export const parseCustomRoutes = (sailsConfig: Sails.Config): Array<ParsedCustom
59
59
for ( const routeAddress in routes ) {
60
60
// Parse 1: Route Address
61
61
// see https://sailsjs.com/documentation/concepts/routes/custom-routes#?route-address
62
- let [ verb , path ] = routeAddress . split ( / \s + / )
62
+ let [ verb = 'get' , path ] = routeAddress . split ( / \s + / )
63
+ verb = verb . toLowerCase ( ) ;
63
64
if ( ! path ) {
64
65
path = verb
65
66
verb = 'all'
You can’t perform that action at this time.
0 commit comments