feat: logging client IP for served playlist and EPG
This commit is contained in:
@@ -164,6 +164,7 @@ func servePlaylist(cfg *Config, r *Refresher) http.HandlerFunc {
|
|||||||
http.Error(w, "stat", http.StatusInternalServerError)
|
http.Error(w, "stat", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
slog.Info("serving playlist", "client", clientIP(req))
|
||||||
w.Header().Set("Content-Type", "application/vnd.apple.mpegurl")
|
w.Header().Set("Content-Type", "application/vnd.apple.mpegurl")
|
||||||
http.ServeContent(w, req, playlistFilename, fi.ModTime(), f)
|
http.ServeContent(w, req, playlistFilename, fi.ModTime(), f)
|
||||||
}
|
}
|
||||||
@@ -188,7 +189,9 @@ func serveEPG(cfg *Config, r *Refresher) http.HandlerFunc {
|
|||||||
return
|
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-Encoding", "gzip")
|
||||||
w.Header().Set("Content-Type", cfg.EPGContentType)
|
w.Header().Set("Content-Type", cfg.EPGContentType)
|
||||||
http.ServeContent(w, req, epgFilename, fi.ModTime(), f)
|
http.ServeContent(w, req, epgFilename, fi.ModTime(), f)
|
||||||
|
|||||||
Reference in New Issue
Block a user