Skip to content

Commit 2daa64d

Browse files
committed
fix method getClientIp()
1 parent 02bfa78 commit 2daa64d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function rollbackTransaction(): bool {
7070
}
7171
public function getClientIp(): string {
7272
if (isset($this->swoole_http_request->header['x-forwarded-for'])) {
73-
return current(explode(', ', $this->swoole_http_request->header['x-forwarded-for']));
73+
return trim(current(explode(',', $this->swoole_http_request->header['x-forwarded-for'])));
7474
}
7575
return $this->swoole_http_request->server['remote_addr'];
7676
}

0 commit comments

Comments
 (0)