Fix WriteHeader order.
This commit is contained in:
@@ -205,16 +205,18 @@ func clientHandler(w http.ResponseWriter, r *http.Request) {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
if r.Method == http.MethodHead {
|
||||
w.Header().Add("Content-Type", "video/MP2T")
|
||||
w.WriteHeader(200)
|
||||
if r.Method == http.MethodHead {
|
||||
// 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 {
|
||||
|
||||
Reference in New Issue
Block a user