forked from Dniel97/artemis
fix IP address logging
This commit is contained in:
parent
4bd1dea6bf
commit
7ca4e6adb9
@ -192,7 +192,7 @@ class AllnetServlet:
|
||||
|
||||
def handle_billing_request(self, request: Request, _: Dict):
|
||||
req_dict = self.billing_req_to_dict(request.content.getvalue())
|
||||
request_ip = request.getClientAddress()
|
||||
request_ip = Utils.get_ip_addr(request)
|
||||
if req_dict is None:
|
||||
self.logger.error(f"Failed to parse request {request.content.getvalue()}")
|
||||
return b""
|
||||
@ -225,7 +225,7 @@ class AllnetServlet:
|
||||
return self.dict_to_http_form_string([vars(resp)])
|
||||
|
||||
msg = (
|
||||
f"Billing checkin from {request.getClientIP()}: game {kc_game} keychip {kc_serial} playcount "
|
||||
f"Billing checkin from {request_ip}: game {kc_game} keychip {kc_serial} playcount "
|
||||
f"{kc_playcount} billing_type {kc_billigtype} nearfull {kc_nearfull} playlimit {kc_playlimit}"
|
||||
)
|
||||
self.logger.info(msg)
|
||||
|
@ -30,7 +30,7 @@ class UserSession(object):
|
||||
|
||||
class FrontendServlet(resource.Resource):
|
||||
def getChild(self, name: bytes, request: Request):
|
||||
self.logger.debug(f"{request.getClientIP()} -> {name.decode()}")
|
||||
self.logger.debug(f"{Utils.get_ip_addr(request)} -> {name.decode()}")
|
||||
if name == b"":
|
||||
return self
|
||||
return resource.Resource.getChild(self, name, request)
|
||||
@ -84,7 +84,7 @@ class FrontendServlet(resource.Resource):
|
||||
)
|
||||
|
||||
def render_GET(self, request):
|
||||
self.logger.debug(f"{request.getClientIP()} -> {request.uri.decode()}")
|
||||
self.logger.debug(f"{Utils.get_ip_addr(request)} -> {request.uri.decode()}")
|
||||
template = self.environment.get_template("core/frontend/index.jinja")
|
||||
return template.render(
|
||||
server_name=self.config.server.name,
|
||||
@ -113,7 +113,7 @@ class FE_Base(resource.Resource):
|
||||
|
||||
class FE_Gate(FE_Base):
|
||||
def render_GET(self, request: Request):
|
||||
self.logger.debug(f"{request.getClientIP()} -> {request.uri.decode()}")
|
||||
self.logger.debug(f"{Utils.get_ip_addr(request)} -> {request.uri.decode()}")
|
||||
uri: str = request.uri.decode()
|
||||
|
||||
sesh = request.getSession()
|
||||
|
Loading…
Reference in New Issue
Block a user