mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 05:42:19 +00:00
Ignore stream name case
This commit is contained in:
parent
dc594d091c
commit
f7cf187bac
@ -42,7 +42,7 @@ func viewerHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// Get stream ID from URL, or from domain name
|
||||
path := r.URL.Path[1:]
|
||||
path := strings.ToLower(r.URL.Path[1:])
|
||||
host := r.Host
|
||||
if strings.Contains(host, ":") {
|
||||
realHost, _, err := net.SplitHostPort(r.Host)
|
||||
@ -52,13 +52,13 @@ func viewerHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
host = realHost
|
||||
}
|
||||
host = strings.ToLower(strings.Replace(host, ".", "-", -1))
|
||||
host = strings.Replace(host, ".", "-", -1)
|
||||
if streamID, ok := cfg.MapDomainToStream[host]; ok {
|
||||
// Move home page to /about
|
||||
if path == "about" {
|
||||
path = ""
|
||||
} else {
|
||||
path = streamID
|
||||
path = strings.ToLower(streamID)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user