owncast/controllers/ping.go

16 lines
350 B
Go
Raw Permalink Normal View History

package controllers
import (
"net/http"
"github.com/owncast/owncast/core"
"github.com/owncast/owncast/models"
)
// Ping is fired by a client to show they are still an active viewer.
func Ping(w http.ResponseWriter, r *http.Request) {
viewer := models.GenerateViewerFromRequest(r)
core.SetViewerActive(&viewer)
2022-05-24 01:12:59 +03:00
w.WriteHeader(http.StatusOK)
}