Skip to content
Browse files

Don't crash when used while middleware was not applied.

Middleware are not always applied when running specs.
  • Loading branch information...
1 parent 7738e45 commit fa57cfbf8203964d01cdb1866f63a7c6bb6356bc @DouweM DouweM committed Sep 8, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/http_accept_language/railtie.rb
View
4 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 fa57cfb

Please sign in to comment.
Something went wrong with that request. Please try again.