i've got a jruby regex that i'm printing in rails:
@@private = /somethingthatshouldnevermatch/
def secure?
puts "security test(#{action_name}/#{@@private}: #{@@private.match(action_name).nil?.to_s}"
action_name =~ @@private
end
on os x, using WEBRick and jruby, this prints
security test(index/(?-mix:somethingthatshouldnevermatch):
on windows, this prints
security test(index/?-mix:):
i used warbler to wrap this up into a war and drop it into a tomcat directory on windows.
what gives?
edit - moar info
issue turned out to be an environment setting. warbler defaults to 'production', instead of dev. however, i still don't understand why it behaved this way.
more specifics - this is the way i'm implementing security in my RoR app. i have a secure?
method on the ApplicationController
, and override the value of @@private
in subclasses. it looks like with the environment set to production, the regex stopped getting initialized in the base class. it was \\
for everyone, which caused the rest of my issues.
ideas?