rack-locale-root-redirect 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack/locale-root-redirect.rb +2 -2
- metadata +1 -1
@@ -2,7 +2,7 @@ require "rack/accept"
|
|
2
2
|
|
3
3
|
module Rack
|
4
4
|
class LocaleRootRedirect
|
5
|
-
VERSION = "0.0.
|
5
|
+
VERSION = "0.0.3"
|
6
6
|
|
7
7
|
def initialize(app, locales = {})
|
8
8
|
@locales = locales
|
@@ -20,7 +20,7 @@ module Rack
|
|
20
20
|
redirect_lang = language_matcher.best_of(@available_locales) || @default_locale
|
21
21
|
|
22
22
|
status = 302
|
23
|
-
headers["Location"] = "#{env["HTTP_HOST"]}#{@locales[redirect_lang.to_sym]}"
|
23
|
+
headers["Location"] = "#{env["SERVER_PROTOCOL"]}://#{env["HTTP_HOST"]}#{@locales[redirect_lang.to_sym]}"
|
24
24
|
end
|
25
25
|
|
26
26
|
[status, headers, response]
|