diff --git a/README.md b/README.md index 6ea2f4a..5c851fe 100644 --- a/README.md +++ b/README.md @@ -315,6 +315,11 @@ properties and methods: * `origin` - The 'origin' for the request, for example: `http://my-api:8008`. * `absoluteUrl` - The absolute URL for the request. +* `ip()` - Returns the ip address of the client. This may be ipv4 or ipv6. + If `CURVEBALL_TRUSTPROXY` is set in the environment and truthy, this will + use the information from the `X-Forwarded-For` header (if available). + + ### The Response interface diff --git a/changelog.md b/changelog.md index 5a4a4be..003b09d 100644 --- a/changelog.md +++ b/changelog.md @@ -16,6 +16,8 @@ Changelog `Response` classes now have an extra constructor argument. This means if you ever manually constructed any of these, there's a small change you'll need to make. Typescript should point all these problems! +* If `CURVEBALL_TRUSTPROXY` is set, `request.ip()` will trust proxies + by default, and return the ip of the real client instead of the proxy. 0.18.0 (2022-04-16)