Remove unused website_address option
This commit is contained in:
@@ -24,7 +24,6 @@ api_url_internal = "https://pixeldrain.com/api"
|
|||||||
# prefix will be derived from there
|
# prefix will be derived from there
|
||||||
api_socket_path = ""
|
api_socket_path = ""
|
||||||
|
|
||||||
website_address = "https://pixeldrain.com"
|
|
||||||
session_cookie_domain = ""
|
session_cookie_domain = ""
|
||||||
resource_dir = "res"
|
resource_dir = "res"
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const defaultThemeColour = "#220735"
|
const defaultThemeColour = "#220735"
|
||||||
|
const defaultHost = "https://pixeldrain.com"
|
||||||
|
|
||||||
type ogData struct {
|
type ogData struct {
|
||||||
MetaPropRules []ogProp
|
MetaPropRules []ogProp
|
||||||
@@ -78,10 +79,12 @@ func generateOGData(name, filetype, pageurl, fileurl, thumbnailurl, themecolour
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getRequestAddress(r *http.Request) (addr string) {
|
func getRequestAddress(r *http.Request) (addr string) {
|
||||||
if r.TLS == nil {
|
if r.Host == "" {
|
||||||
return "http://" + r.Header.Get("Host")
|
return defaultHost
|
||||||
|
} else if r.TLS == nil {
|
||||||
|
return "http://" + r.Host
|
||||||
} else {
|
} else {
|
||||||
return "https://" + r.Header.Get("Host")
|
return "https://" + r.Host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,7 +23,6 @@ type Config struct {
|
|||||||
APIURLExternal string `toml:"api_url_external"`
|
APIURLExternal string `toml:"api_url_external"`
|
||||||
APIURLInternal string `toml:"api_url_internal"`
|
APIURLInternal string `toml:"api_url_internal"`
|
||||||
APISocketPath string `toml:"api_socket_path"`
|
APISocketPath string `toml:"api_socket_path"`
|
||||||
WebsiteAddress string `toml:"website_address"`
|
|
||||||
SessionCookieDomain string `toml:"session_cookie_domain"`
|
SessionCookieDomain string `toml:"session_cookie_domain"`
|
||||||
ResourceDir string `toml:"resource_dir"`
|
ResourceDir string `toml:"resource_dir"`
|
||||||
DebugMode bool `toml:"debug_mode"`
|
DebugMode bool `toml:"debug_mode"`
|
||||||
|
Reference in New Issue
Block a user