getCurrentEvent capturing includes/styles


I've written an "analytics" interceptor to capture stats about my app.
And I can seem to figure out why in my preProcess() when I call
arguments.event.getCurrentEvent() its capturing my /includes/styles
directory as a requested event!? More precisely it's capturing it as
an event: package.includes.styles

I've also noticed this else where when I'm doing exception handling
I'll get random errors coming from this event...

any thoughts?

coldfusion 9
coldbox 2.6.4

Are you using url rewrites?

yes. I am using coldbox's ses intereceptor.

not apache or iis rewrites...

Hmm, then it is weird because it means that somebody is making a request to those files and it is getting parsed. I would double check the requests.

nope no one is requesting those directories explicitly. the frameworks
execution events are capturing that somehow...

I'm closely monitoring this app, as not many people are even using it
yet. Its still under development.

any thoughts?

I have seen that before with rewrites an Ajax requests sometimes. Hard to track. I would setup a dev interceptor that runs at preprocess as the firt one and logs incoming requests with path info cgi query etc.

Are you using relative urls for your styles? I vaguely recall something similar happening to me and absolute urls fixed it.

  • Gabriel

In my layouts? yes Im using relative paths to my stylesheets...

Absolute urls fixed a similar issue for me. Never found out why, but at least it went away.

  • Gabriel

I'm using SES URLs with relative style sheets and I occasionally get weird errors in the logs for URLs that look something like this:

Of course, /css/styles.css is supposed to be relative to the root. With almost no exception, when I look at the user agent, it is a bot or blank (a bot). It seems to always be related to some poor attempt to spider my site.

I can see how absolute URLs would help, because then the poorly-coded bots won't be trying to guess how the paths work.



are you using a robots.txt on your root of your app?

I can’t speak for the OP, but my site uses the default robots.txt that came with CB. I kind of figure the kind of nameless, sleazy bots that can’t figure out relative paths probably don’t pay attention to robot.txt files anyway though.

User-Agent: *
Disallow: /config/
Disallow: /handlers/
Disallow: /includes/
Disallow: /interceptors/
Disallow: /layouts/
Disallow: /logs/
Disallow: /model/
Disallow: /plugins/
Disallow: /views/
Allow: /

ack! that's right... I recall now I had to put absolute paths for my
assets on a previous cb app.

whats up with dat? :slight_smile: anyway no biggie.

thanks guys