152 real_ip = ip_address(get_real_ip(request))
153 network = get_network(real_ip, cfg)
155 if request.path ==
'/healthz':
160 if network.is_link_local:
172 match, msg = ip_lists.pass_ip(real_ip, cfg)
174 logger.warning(
"PASS %s: matched PASSLIST - %s", network.compressed, msg)
177 match, msg = ip_lists.block_ip(real_ip, cfg)
179 logger.error(
"BLOCK %s: matched BLOCKLIST - %s", network.compressed, msg)
180 return flask.make_response((
'IP is on BLOCKLIST - %s' % msg, 429))
187 val = func.filter_request(network, request, cfg)
193 if request.path ==
'/search':
197 http_accept_encoding,
198 http_accept_language,
202 val = func.filter_request(network, request, cfg)
205 logger.debug(f
"OK {network}: %s", dump_request(sxng_request))