Mercurial > kallithea
comparison kallithea/config/middleware/wrapper.py @ 8791:b3d8a3000a7f
lib: cleanup of _get_ip_addr
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 10 Nov 2020 17:43:37 +0100 |
parents | f8971422795e |
children | 4f0de9468da3 |
comparison
equal
deleted
inserted
replaced
8790:5e8f46e868e8 | 8791:b3d8a3000a7f |
---|---|
27 """ | 27 """ |
28 | 28 |
29 import logging | 29 import logging |
30 import time | 30 import time |
31 | 31 |
32 from kallithea.lib.base import _get_ip_addr, get_path_info | 32 from kallithea.lib.base import get_ip_addr, get_path_info |
33 | 33 |
34 | 34 |
35 log = logging.getLogger(__name__) | 35 log = logging.getLogger(__name__) |
36 | 36 |
37 | 37 |
89 self.config = config | 89 self.config = config |
90 | 90 |
91 def __call__(self, environ, start_response): | 91 def __call__(self, environ, start_response): |
92 meter = Meter(start_response) | 92 meter = Meter(start_response) |
93 description = "Request from %s for %s" % ( | 93 description = "Request from %s for %s" % ( |
94 _get_ip_addr(environ), | 94 get_ip_addr(environ), |
95 get_path_info(environ), | 95 get_path_info(environ), |
96 ) | 96 ) |
97 log.info("%s received", description) | 97 log.info("%s received", description) |
98 try: | 98 try: |
99 result = self.application(environ, meter.start_response) | 99 result = self.application(environ, meter.start_response) |