Commit 0251fb43 authored by o@immerda.ch's avatar o@immerda.ch
Browse files

fix npe on empty language header

parent 4d1a5e2d
......@@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base
before_action :set_locale
def extract_locale
request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first
(request.env['HTTP_ACCEPT_LANGUAGE']||'').scan(/^[a-z]{2}/).first
end
def set_locale
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment