lib/sufia/http_header_auth.rb in sufia-0.0.1.pre1 vs lib/sufia/http_header_auth.rb in sufia-0.0.1.pre2
- old
+ new
@@ -6,9 +6,18 @@
## Force the session to be restarted on every request. The ensures that when the REMOTE_USER header is not set, the user will be logged out.
prepend_before_filter :clear_session_user
before_filter :filter_notify
end
+ def self.get_vhost_by_host(config)
+ hosts_vhosts_map = config.hosts_vhosts_map
+ hostname = Socket.gethostname
+ vhost = hosts_vhosts_map[hostname] || "https://#{hostname}/"
+ service = URI.parse(vhost).host
+ port = URI.parse(vhost).port
+ service << "-#{port}" unless port == 443
+ return [service, vhost]
+ end
def clear_session_user
if request.nil?
logger.warn "Request is Nil, how weird!!!"
return
end