Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub committed Feb 19, 2024
1 parent 1f95b1a commit 8d7855a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions application/handler/tool/ip2region.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ func IP2Region(c echo.Context) error {
ip = lanIP
}
}
c.Set(`clientIP`, echo.H{
`RemoteAddress`: c.Request().RemoteAddress(),
`Forwarded`: c.Header(`Forwarded`),
`X-Forwarded-For`: c.Header(`X-Forwarded-For`),
`X-Forwarded-Proto`: c.Header(`X-Forwarded-Proto`),
`X-Real-IP`: c.Header(`X-Real-IP`),
})
c.Request().Form().Set(`ip`, ip)
}
if !c.IsPost() {
Expand Down

0 comments on commit 8d7855a

Please sign in to comment.