lib/vidibus/user/warden/helper.rb in vidibus-user-1.0.0 vs lib/vidibus/user/warden/helper.rb in vidibus-user-1.0.1
- old
+ new
@@ -35,16 +35,17 @@
def client
@client ||= OAuth2::Client.new(credentials[:client_id], credentials[:client_secret], :site => credentials[:service_url])
end
# Returns current host.
+ # TODO: return forwarded host, if proxied
def host
"#{protocol}#{env['HTTP_HOST']}"
end
# Returns protocol depending on SERVER_PORT.
def protocol
- env['SERVER_PORT'] == 443 ? 'https://' : 'http://'
+ env['SERVER_PORT'].to_i == 443 ? 'https://' : 'http://'
end
def logger
Vidibus::User.logger
end