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.
@@ -2,7 +2,7 @@ require "rack/accept"
2
2
 
3
3
  module Rack
4
4
  class LocaleRootRedirect
5
- VERSION = "0.0.2"
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-locale-root-redirect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: