mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
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:
@@ -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}`);
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user