diff --git a/main.go b/main.go index 58eac18..2bac3ad 100644 --- a/main.go +++ b/main.go @@ -205,16 +205,18 @@ func clientHandler(w http.ResponseWriter, r *http.Request) { http.NotFound(w, r) return } - w.Header().Add("Content-Type", "video/MP2T") - w.WriteHeader(200) if r.Method == http.MethodHead { + w.Header().Add("Content-Type", "video/MP2T") + w.WriteHeader(200) // Fuck you golang, you should never eat write but fail return } if r.Method != http.MethodGet { - w.WriteHeader(405) + http.Error(w, "405 method not allowed", 405) return } + w.Header().Add("Content-Type", "video/MP2T") + w.WriteHeader(200) ch := NewClientChannel(name) defer ch.Close() for {