(request: FastifyRequest)
| 2 | import type { FastifyRequest } from 'fastify'; |
| 3 | |
| 4 | export async function ipHook(request: FastifyRequest) { |
| 5 | const { ip, header } = getClientIpFromHeaders(request.headers); |
| 6 | |
| 7 | if (ip) { |
| 8 | request.clientIp = ip; |
| 9 | request.clientIpHeader = header; |
| 10 | } else { |
| 11 | request.clientIp = ''; |
| 12 | request.clientIpHeader = ''; |
| 13 | } |
| 14 | } |
nothing calls this directly
no test coverage detected