150 real_ip = ip_address(get_real_ip(request))
151 network = get_network(real_ip, cfg)
153 if request.path ==
'/healthz':
158 if network.is_link_local:
170 match, msg = ip_lists.pass_ip(real_ip, cfg)
172 logger.warning(
"PASS %s: matched PASSLIST - %s", network.compressed, msg)
175 match, msg = ip_lists.block_ip(real_ip, cfg)
177 logger.error(
"BLOCK %s: matched BLOCKLIST - %s", network.compressed, msg)
178 return flask.make_response((
'IP is on BLOCKLIST - %s' % msg, 429))
185 val = func.filter_request(network, request, cfg)
191 if request.path ==
'/search':
195 http_accept_encoding,
196 http_accept_language,
200 val = func.filter_request(network, request, cfg)
203 logger.debug(f
"OK {network}: %s", dump_request(flask.request))