Remove unused website_address option

This commit is contained in:
2024-09-09 14:51:12 +02:00
parent 9bf31b1eb1
commit 239c0c6523
3 changed files with 6 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import (
)
const defaultThemeColour = "#220735"
const defaultHost = "https://pixeldrain.com"
type ogData struct {
MetaPropRules []ogProp
@@ -78,10 +79,12 @@ func generateOGData(name, filetype, pageurl, fileurl, thumbnailurl, themecolour
}
func getRequestAddress(r *http.Request) (addr string) {
if r.TLS == nil {
return "http://" + r.Header.Get("Host")
if r.Host == "" {
return defaultHost
} else if r.TLS == nil {
return "http://" + r.Host
} else {
return "https://" + r.Header.Get("Host")
return "https://" + r.Host
}
}

View File

@@ -23,7 +23,6 @@ type Config struct {
APIURLExternal string `toml:"api_url_external"`
APIURLInternal string `toml:"api_url_internal"`
APISocketPath string `toml:"api_socket_path"`
WebsiteAddress string `toml:"website_address"`
SessionCookieDomain string `toml:"session_cookie_domain"`
ResourceDir string `toml:"resource_dir"`
DebugMode bool `toml:"debug_mode"`