Fix WriteHeader order.
This commit is contained in:
@@ -205,16 +205,18 @@ func clientHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
w.Header().Add("Content-Type", "video/MP2T")
|
|
||||||
w.WriteHeader(200)
|
|
||||||
if r.Method == http.MethodHead {
|
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
|
// Fuck you golang, you should never eat write but fail
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if r.Method != http.MethodGet {
|
if r.Method != http.MethodGet {
|
||||||
w.WriteHeader(405)
|
http.Error(w, "405 method not allowed", 405)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
w.Header().Add("Content-Type", "video/MP2T")
|
||||||
|
w.WriteHeader(200)
|
||||||
ch := NewClientChannel(name)
|
ch := NewClientChannel(name)
|
||||||
defer ch.Close()
|
defer ch.Close()
|
||||||
for {
|
for {
|
||||||
|
|||||||
Reference in New Issue
Block a user