Workaround for IPTVX content-type bug
This commit is contained in:
@@ -206,7 +206,7 @@ func Auto(w http.ResponseWriter, r *http.Request) {
|
|||||||
// xTeVe : Web Server /xmltv/ und /m3u/
|
// xTeVe : Web Server /xmltv/ und /m3u/
|
||||||
func xTeVe(w http.ResponseWriter, r *http.Request) {
|
func xTeVe(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var requestType, groupTitle, file, content string
|
var requestType, groupTitle, file, content, contentType string
|
||||||
var err error
|
var err error
|
||||||
var path = strings.TrimPrefix(r.URL.Path, "/")
|
var path = strings.TrimPrefix(r.URL.Path, "/")
|
||||||
var groups = []string{}
|
var groups = []string{}
|
||||||
@@ -226,8 +226,6 @@ func xTeVe(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", http.DetectContentType([]byte(content)))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// M3U Datei
|
// M3U Datei
|
||||||
@@ -261,6 +259,13 @@ func xTeVe(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contentType = http.DetectContentType([]byte(content))
|
||||||
|
if strings.Contains(strings.ToLower(contentType), "xml") {
|
||||||
|
contentType = "application/xml; charset=utf-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
w.Header().Set("Content-Type", contentType)
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
w.Write([]byte(content))
|
w.Write([]byte(content))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user