mirror of
https://github.com/EDCD/EDDN.git
synced 2025-05-08 02:51:04 +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.
|
# semi-useful error message, so do so.
|
||||||
try:
|
try:
|
||||||
logger.error(
|
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,
|
request.content_length,
|
||||||
"<<UNKNOWN>>",
|
"<<UNKNOWN>>",
|
||||||
"<<UNKNOWN>>",
|
"<<UNKNOWN>>",
|
||||||
@ -251,7 +251,7 @@ def parse_and_error_handle(data: bytes) -> str:
|
|||||||
parsed_message
|
parsed_message
|
||||||
)
|
)
|
||||||
logger.info(
|
logger.info(
|
||||||
"Accepted (%d, '%s', '%s', '%s', '%s', '%s') from %s",
|
"Accepted (%d, '%s', '%s', '%s', '%s', '%s') from [%s]",
|
||||||
request.content_length,
|
request.content_length,
|
||||||
uploader_id,
|
uploader_id,
|
||||||
software_name,
|
software_name,
|
||||||
@ -274,7 +274,7 @@ def parse_and_error_handle(data: bytes) -> str:
|
|||||||
parsed_message
|
parsed_message
|
||||||
)
|
)
|
||||||
logger.error(
|
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),
|
str(validation_results.messages),
|
||||||
request.content_length,
|
request.content_length,
|
||||||
uploader_id,
|
uploader_id,
|
||||||
@ -314,7 +314,7 @@ def upload() -> str:
|
|||||||
try:
|
try:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"gzip error ({request.content_length}, '<<UNKNOWN>>', '<<UNKNOWN>>', '<<UNKNOWN>>'"
|
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:
|
except Exception as e:
|
||||||
@ -328,7 +328,7 @@ def upload() -> str:
|
|||||||
# They probably sent an encoded POST, but got the key/val wrong.
|
# They probably sent an encoded POST, but got the key/val wrong.
|
||||||
response.status = 400
|
response.status = 400
|
||||||
# TODO: Maybe just `{exc}` ?
|
# 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)
|
return "FAIL: Malformed Upload: " + str(exc)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user