Method: Waw::StaticController::WawAccess#apply_rules

Defined in:
lib/waw/controllers/static/waw_access.rb

#apply_rules(env) ⇒ Object

Applies the rules defined here or delegate to the parent if allowed



205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/waw/controllers/static/waw_access.rb', line 205

def apply_rules(env)
  if match = find_match(env)
    match.__execute(env)
  elsif (parent and inherits)
    parent.apply_rules(env)
  else
    body = "File not found: #{env['PATH_INFO']}\n"
    [404, {"Content-Type" => "text/plain",
           "Content-Length" => body.size.to_s,
           "X-Cascade" => "pass"},
     [body]]
  end
end