mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-03 04:46:19 -05:00
fix: improve header value retrieval for IP address extraction (#1865)
This commit is contained in:
@@ -26,7 +26,7 @@ export function getIp(
|
||||
];
|
||||
const headers = "headers" in req ? req.headers : req;
|
||||
for (const key of keys) {
|
||||
const value = headers.get(key);
|
||||
const value = "get" in headers ? headers.get(key): headers[key];
|
||||
if (typeof value === "string") {
|
||||
const ip = value.split(",")[0].trim();
|
||||
if (ip) return ip;
|
||||
|
||||
Reference in New Issue
Block a user