Permalink
Browse files

Merge pull request #19 from DouweM/no-middleware-no-crash

Don't crash when used while middleware was not applied.
  • Loading branch information...
2 parents 7738e45 + fa57cfb commit d5015356605f3390aa8c801db6bfcb5cb9627c6d @DouweM DouweM committed Sep 6, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/http_accept_language/railtie.rb
@@ -12,9 +12,11 @@ class Railtie < ::Rails::Railtie
end
module EasyAccess
+
def http_accept_language
- env.http_accept_language
+ @http_accept_language ||= env.respond_to?(:http_accept_language) ? env.http_accept_language : Parser.new("")
end
+
end
end

0 comments on commit d501535

Please sign in to comment.