Skip to content

Commit

Permalink
Patch fix for coldbox so that private event handler actions throw a 4…
Browse files Browse the repository at this point in the history
…04 when attempted to be accessed through a URL instead of a 500 error
  • Loading branch information
DominicWatson committed Jan 29, 2015
1 parent c72b16b commit 5bc23cf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions system/coldboxModifications/services/HandlerService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ component extends="coldbox.system.web.services.HandlerService" output=false {
return getRegisteredHandler( handlerBean.getFullEvent() );
}

public any function getHandler( required any ehBean, required any requestContext ) output=false {
try {
return super.getHandler( argumentCollection=arguments );
} catch( expression e ) {
if ( ( e.message ?: "" ) contains "has no accessible Member with name" ) {
invalidEvent( arguments.ehBean.getFullEvent(), arguments.ehBean );

return getHandler( getRegisteredHandler( arguments.ehBean.getFullEvent()), arguments.requestContext );
} else {
rethrow;
}
}
}

public array function listHandlers( string thatStartWith="" ) output=false {
var handlers = {};
var startWithLen = Len( arguments.thatStartWith );
Expand Down

0 comments on commit 5bc23cf

Please sign in to comment.