feat: logging client IP for served playlist and EPG

This commit is contained in:
2026-05-06 12:00:29 +02:00
parent eb43106315
commit d9037229bb
+4 -1
View File
@@ -164,6 +164,7 @@ func servePlaylist(cfg *Config, r *Refresher) http.HandlerFunc {
http.Error(w, "stat", http.StatusInternalServerError)
return
}
slog.Info("serving playlist", "client", clientIP(req))
w.Header().Set("Content-Type", "application/vnd.apple.mpegurl")
http.ServeContent(w, req, playlistFilename, fi.ModTime(), f)
}
@@ -188,7 +189,9 @@ func serveEPG(cfg *Config, r *Refresher) http.HandlerFunc {
return
}
if clientAcceptsGzip(req) {
gz := clientAcceptsGzip(req)
slog.Info("serving epg", "client", clientIP(req), "gzip", gz)
if gz {
w.Header().Set("Content-Encoding", "gzip")
w.Header().Set("Content-Type", cfg.EPGContentType)
http.ServeContent(w, req, epgFilename, fi.ModTime(), f)