Fix IP address retrieval in server response (#23813)

### What does this PR do?
Fix, response example - requestIP return object.

<img width="521" height="116" alt="image"
src="https://github.com/user-attachments/assets/14b90a8e-3230-4eb1-8f87-ee06392029cd"
/>

↓
<img width="333" height="115" alt="image"
src="https://github.com/user-attachments/assets/ecf006b3-f02a-4bed-8b8c-b28b8ec2adc8"
/>

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
mariusz4044
2025-10-19 01:53:28 +02:00
committed by GitHub
parent 2ebf6c16b6
commit 8e34ec311e

View File

@@ -536,7 +536,7 @@ You can also access the `Server` object from the `fetch` handler. It's the secon
const server = Bun.serve({
fetch(req, server) {
const ip = server.requestIP(req);
return new Response(`Your IP is ${ip}`);
return new Response(`Your IP is ${ip.address}`);
},
});
```