[Coldbox 4] Interceptor

Hello fellow CFers,

I came across something today when utilizing my first interceptor and attempting to use the eventPattern annotation.

In the documents (http://wiki.coldbox.org/wiki/Interceptors.cfm), it gives examples of escaping the period with a backlash which seems appropriate. (IE “^admin.”)
However, I could not get the interceptor to fire off and found that by removing the backslash and leaving the period as is, the interceptor method finally fired off.

I don’t know if this legitimately correct when knowing about regex, but this is just an observation so at least it can be addressed if it is a bug or if the documentation is incorrect.

Have a great day!
Ryan Hinton

What is the name of the event you are trying to match?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

The following is the top portion of the method I am using:

component output=“false” displayname=“API Security Interception Point” {

function preProcess(event, interceptData, buffer) eventPattern="^api." {

It works in this manner. Are you thinking that I may not have this set up properly?

Thank you,
Ryan Hinton

Sorry, that’s not what I meant. What URL is the user hitting in their browser when you expect your interceptor to fire? I can see the regex you’re using, but until I know what that regex is being matched against, it’s impossible for me to tell if it’s correct.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

No worries, I misunderstood you.

This is the URL:
http://localhost/api/invoice/list?fwreinit=1

I have the API as a module, if you are attempting to mock it up.

Thank you,
Ryan Hinton