MCPcopy Create free account
hub / github.com/github/docs / remoteIp

Function remoteIp

middleware/remote-ip.js:3–10  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

1import { noCacheControl } from './cache-control.js'
2
3export default function remoteIp(req, res) {
4 noCacheControl(res)
5 res.json({
6 ip: req.ip,
7 'x-forwarded-for': req.headers['x-forwarded-for'] || null,
8 'fastly-client-ip': req.headers['fastly-client-ip'] || null,
9 })
10}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected