17 lines
392 B
Go
17 lines
392 B
Go
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)
|
|
}
|