151 real_ip = ip_address(get_real_ip(request))
152 network = get_network(real_ip, cfg)
154 if request.path ==
'/healthz':
159 if network.is_link_local:
171 match, msg = ip_lists.pass_ip(real_ip, cfg)
173 logger.warning(
"PASS %s: matched PASSLIST - %s", network.compressed, msg)
176 match, msg = ip_lists.block_ip(real_ip, cfg)
178 logger.error(
"BLOCK %s: matched BLOCKLIST - %s", network.compressed, msg)
179 return flask.make_response((
'IP is on BLOCKLIST - %s' % msg, 429))
186 val = func.filter_request(network, request, cfg)
192 if request.path ==
'/search':
196 http_accept_encoding,
197 http_accept_language,
201 val = func.filter_request(network, request, cfg)
204 logger.debug(f
"OK {network}: %s", dump_request(flask.request))