Check if proxy protocol is allowed from this peer.
(self)
| 657 | return buf |
| 658 | |
| 659 | def proxy_protocol_access_check(self): |
| 660 | """Check if proxy protocol is allowed from this peer.""" |
| 661 | if (isinstance(self.peer_addr, tuple) and |
| 662 | not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips, |
| 663 | self.cfg.proxy_allow_networks())): |
| 664 | raise ForbiddenProxyRequest(self.peer_addr[0]) |
| 665 | |
| 666 | def _parse_proxy_protocol_v1(self, unreader, buf): |
| 667 | """Parse PROXY protocol v1 (text format). |
no test coverage detected