diff --git a/vlib/net/http/server.v b/vlib/net/http/server.v index 64acc0a126..89e92566c5 100644 --- a/vlib/net/http/server.v +++ b/vlib/net/http/server.v @@ -100,13 +100,17 @@ fn (mut s Server) parse_and_respond(mut conn net.TcpConn) { reader.free() } } - req := parse_request(mut reader) or { + mut req := parse_request(mut reader) or { $if debug { // only show in debug mode to prevent abuse eprintln('error parsing request: ${err}') } return } + + remote_ip := conn.peer_ip() or { '' } + req.header.add_custom('Remote-Addr', remote_ip) or {} + mut resp := s.handler.handle(req) if resp.version() == .unknown { resp.set_version(req.version)