Take the hostname from the request
This commit is contained in:
parent
3e3ba1bd7e
commit
3bb3cf9489
3 changed files with 8 additions and 9 deletions
|
@ -36,7 +36,11 @@ type Status struct {
|
|||
|
||||
func GetStatus(h handler) Status {
|
||||
var s Status
|
||||
s.BaseURL = "http://" + h.hostname
|
||||
host := h.r.Host
|
||||
s.BaseURL = "https://" + host
|
||||
if strings.HasSuffix(host, ".onion") || strings.Contains(host, "localhost") {
|
||||
s.BaseURL = "http://" + host
|
||||
}
|
||||
s.FullURL = s.BaseURL + h.r.RequestURI
|
||||
s.Title = "Imperial Library of Trantor"
|
||||
s.User = h.sess.User
|
||||
|
|
Reference in a new issue