Skip to content

Commit ac0a38d

Browse files
committed
Fixed Context#RealIP() to fetch the first IP
Signed-off-by: Vishal Rana <[email protected]>
1 parent a87261e commit ac0a38d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func (c *context) Scheme() string {
231231
func (c *context) RealIP() string {
232232
ra := c.request.RemoteAddr
233233
if ip := c.request.Header.Get(HeaderXForwardedFor); ip != "" {
234-
ra = ip
234+
ra = strings.Split(ip, ", ")[0]
235235
} else if ip := c.request.Header.Get(HeaderXRealIP); ip != "" {
236236
ra = ip
237237
} else {

0 commit comments

Comments
 (0)