photoprism/internal/api/api_request.go
Michael Mayer 023fbe3a1d Pkg: Add service/cluster package & rename media/http → service/http #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-13 12:58:28 +02:00

17 lines
464 B
Go

package api
import (
"github.com/gin-gonic/gin"
"github.com/photoprism/photoprism/pkg/service/http/header"
)
// ClientIP returns the client IP address from the request context or a placeholder if it is unknown.
func ClientIP(c *gin.Context) (ip string) {
return header.ClientIP(c)
}
// UserAgent returns the user agent from the request context or an empty string if it is unknown.
func UserAgent(c *gin.Context) string {
return header.ClientUserAgent(c)
}