Skip to content
This repository was archived by the owner on Sep 2, 2020. It is now read-only.

Commit 01d065e

Browse files
authored
fix(cbguard): Ensure implicit view events are still allowed
Ignore events without a handler. Let ColdBox take care of them.
1 parent 72ba3d0 commit 01d065e

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

interceptors/SecuredEventInterceptor.cfc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ component extends="coldbox.system.Interceptor"{
2727
}
2828

2929
var handlerBean = handlerService.getHandlerBean( event.getCurrentEvent() );
30+
if ( handlerBean.getHandler() == "" ) {
31+
return;
32+
}
33+
3034
if ( ! handlerBean.isMetadataLoaded() ) {
3135
handlerService.getHandler( handlerBean, event );
3236
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Test</h1>

tests/specs/integration/AuthenticationSpec.cfc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" {
6363
var event = execute( event = "PartiallySecured.secured" );
6464
expect( event.getValue( "event", "" ) ).toBe( "PartiallySecured.secured" );
6565
} );
66+
67+
it( "does nothing if the event is for an has no handler", function() {
68+
var event = execute( event = "without.handlers" );
69+
expect( event.getValue( "event", "" ) ).toBe( "without.handlers" );
70+
} );
6671
} );
6772
}
6873

0 commit comments

Comments
 (0)