1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

PWA: Warning and cache visible entries

This commit is contained in:
Brieuc Dubois 2024-06-22 12:58:42 +02:00
parent 925ea2c082
commit c50edd735a
4 changed files with 41 additions and 3 deletions

View file

@ -140,6 +140,11 @@ func LastForceRefresh(r *http.Request) int64 {
return timestamp
}
// Determine if the request is from a service worker.
func IsServiceWorker(r *http.Request) bool {
return r.Header.Get("Client-Type") == "service-worker"
}
// ClientIP returns the client IP address stored in the context.
func ClientIP(r *http.Request) string {
return getContextStringValue(r, ClientIPContextKey)