mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-28 22:22:13 +03:00
Gateway: Put remote_addr in [], as it could be multiple, comma-separated
# Conflicts: # src/eddn/Gateway.py # Conflicts: # src/eddn/Gateway.py
This commit is contained in:
parent
9bf24f9a05
commit
d5dbc3262f
@ -208,7 +208,7 @@ def parse_and_error_handle(data: bytes) -> str:
|
||||
# semi-useful error message, so do so.
|
||||
try:
|
||||
logger.error(
|
||||
"Error - JSON parse failed (%d, '%s', '%s', '%s', '%s', '%s') from %s:\n%s\n",
|
||||
"Error - JSON parse failed (%d, '%s', '%s', '%s', '%s', '%s') from [%s]:\n%s\n",
|
||||
request.content_length,
|
||||
"<<UNKNOWN>>",
|
||||
"<<UNKNOWN>>",
|
||||
@ -251,7 +251,7 @@ def parse_and_error_handle(data: bytes) -> str:
|
||||
parsed_message
|
||||
)
|
||||
logger.info(
|
||||
"Accepted (%d, '%s', '%s', '%s', '%s', '%s') from %s",
|
||||
"Accepted (%d, '%s', '%s', '%s', '%s', '%s') from [%s]",
|
||||
request.content_length,
|
||||
uploader_id,
|
||||
software_name,
|
||||
@ -274,7 +274,7 @@ def parse_and_error_handle(data: bytes) -> str:
|
||||
parsed_message
|
||||
)
|
||||
logger.error(
|
||||
"Failed Validation '%s' (%d, '%s', '%s', '%s', '%s', '%s') from %s",
|
||||
"Failed Validation '%s' (%d, '%s', '%s', '%s', '%s', '%s') from [%s]",
|
||||
str(validation_results.messages),
|
||||
request.content_length,
|
||||
uploader_id,
|
||||
@ -314,7 +314,7 @@ def upload() -> str:
|
||||
try:
|
||||
logger.error(
|
||||
f"gzip error ({request.content_length}, '<<UNKNOWN>>', '<<UNKNOWN>>', '<<UNKNOWN>>'"
|
||||
", '<<UNKNOWN>>', '<<UNKNOWN>>') from {get_remote_address()}"
|
||||
", '<<UNKNOWN>>', '<<UNKNOWN>>') from [{get_remote_address()}]"
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
@ -328,7 +328,7 @@ def upload() -> str:
|
||||
# They probably sent an encoded POST, but got the key/val wrong.
|
||||
response.status = 400
|
||||
# TODO: Maybe just `{exc}` ?
|
||||
logger.error("MalformedUploadError from %s: %s", get_remote_address(), str(exc))
|
||||
logger.error("MalformedUploadError from [%s]: %s", get_remote_address(), str(exc))
|
||||
|
||||
return "FAIL: Malformed Upload: " + str(exc)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user