mirror of
https://github.com/adnanh/webhook.git
synced 2025-10-06 06:31:02 +00:00
chore: go mod vendor
This commit is contained in:
parent
f93670d9ae
commit
90fdae322f
429 changed files with 88019 additions and 123699 deletions
6
vendor/github.com/go-chi/chi/middleware/realip.go
generated
vendored
6
vendor/github.com/go-chi/chi/middleware/realip.go
generated
vendored
|
@ -40,14 +40,14 @@ func RealIP(h http.Handler) http.Handler {
|
|||
func realIP(r *http.Request) string {
|
||||
var ip string
|
||||
|
||||
if xff := r.Header.Get(xForwardedFor); xff != "" {
|
||||
if xrip := r.Header.Get(xRealIP); xrip != "" {
|
||||
ip = xrip
|
||||
} else if xff := r.Header.Get(xForwardedFor); xff != "" {
|
||||
i := strings.Index(xff, ", ")
|
||||
if i == -1 {
|
||||
i = len(xff)
|
||||
}
|
||||
ip = xff[:i]
|
||||
} else if xrip := r.Header.Get(xRealIP); xrip != "" {
|
||||
ip = xrip
|
||||
}
|
||||
|
||||
return ip
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue