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