Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #99 from hron84/hron84/rack-locale/fix-protect-hea…

…der-overwrite

Preventing unintended overwrite of Content-Language header
  • Loading branch information...
commit c624e1ae4390667e355a7467632b5228716ba551 2 parents 68a8da0 + 0a9f99c
@raggi raggi authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/rack/contrib/locale.rb
View
2  lib/rack/contrib/locale.rb
@@ -13,7 +13,7 @@ def call(env)
locale = accept_locale(env) || I18n.default_locale
locale = env['rack.locale'] = I18n.locale = locale.to_s
status, headers, body = @app.call(env)
- headers['Content-Language'] = locale
+ headers['Content-Language'] = locale unless headers['Content-Language']
[status, headers, body]
ensure
I18n.locale = old_locale
Please sign in to comment.
Something went wrong with that request. Please try again.