Guest User

Untitled

a guest
Feb 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. module Merb
  2. module Rack
  3. class Application
  4.  
  5. def call(env)
  6. begin
  7. rack_response = ::Merb::Dispatcher.handle(Merb::Request.new(env))
  8. rescue Object => e
  9. return [500, {Merb::Const::CONTENT_TYPE => "text/html"}, e.message + "<br/>" + e.backtrace.join("<br/>")]
  10. end
  11. Merb.logger.info "\n\n"
  12. Merb.logger.flush
  13.  
  14. # unless controller.headers[Merb::Const::DATE]
  15. # require "time"
  16. # controller.headers[Merb::Const::DATE] = Time.now.rfc2822.to_s
  17. # end
  18. rack_response
  19. end
  20.  
  21. def deferred?(env)
  22. path = env[Merb::Const::PATH_INFO] ? env[Merb::Const::PATH_INFO].chomp('/') : ""
  23. if path =~ Merb.deferred_actions
  24. Merb.logger.info! "Deferring Request: #{path}"
  25. true
  26. else
  27. false
  28. end
  29. end # deferred?(env)
  30. end # Application
  31. end # Rack
  32. end # Merb
Add Comment
Please, Sign In to add comment