From a2efa1126f782b32db2938627b679dbddad57aa9 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 13 Oct 2020 17:25:00 +0200 Subject: [PATCH] Underscores are ignored by YAML, uses dashes --- docs/ghostream.example.yml | 4 ++-- web/handler.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ghostream.example.yml b/docs/ghostream.example.yml index f583472..c739121 100644 --- a/docs/ghostream.example.yml +++ b/docs/ghostream.example.yml @@ -119,10 +119,10 @@ web: # e.g., on http://stream.example.com:8080/, if the domain stream.example.com is mapped to "example", # the stream served will be "example". # This implies that your domain will be able to serve only one stream. - # Dots in the domain name must be remplaced by underscores to avoid yaml issues. + # Dots in the domain name must be remplaced by dashes to avoid yaml issues. # #mapDomainToStream: - # stream_example_com: example + # stream-example-com: example # Stream player poster # Shown when stream is loading or inactive. diff --git a/web/handler.go b/web/handler.go index cf3a04d..d390db6 100644 --- a/web/handler.go +++ b/web/handler.go @@ -32,8 +32,8 @@ func viewerPostHandler(w http.ResponseWriter, r *http.Request) { return } host = realHost - host = strings.Replace(host, ".", "_", -1) } + host = strings.Replace(host, ".", "-", -1) if streamID, ok := cfg.MapDomainToStream[host]; ok { path = streamID } @@ -82,8 +82,8 @@ func viewerGetHandler(w http.ResponseWriter, r *http.Request) { return } host = realHost - host = strings.Replace(host, ".", "_", -1) } + host = strings.Replace(host, ".", "-", -1) if streamID, ok := cfg.MapDomainToStream[host]; ok { if path == "about" { path = ""