@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/pub/common/useragent"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// applyClientForwardHeaders 向上游透传客户端 IP / UA(与 API 上游一致):
|
||||
// X-Real-IP、User-Agent、X-User-Agent。
|
||||
func applyClientForwardHeaders(header map[string]string, c *gin.Context) {
|
||||
if header == nil {
|
||||
return
|
||||
}
|
||||
useragent.ApplyToHeader(header, c, useragent.DefaultVer)
|
||||
}
|
||||
Reference in New Issue
Block a user