fix(server): tolerate malformed request logging

This commit is contained in:
Frank Song authored and nesquena-hermes committed 2026-05-24 15:52:00 +00:00
1 parent 2e876ea229
commit 618e1a5da8
3 files changed
+26 -2

No files matched your search

+2 -2
View File
@@ -232,8 +232,8 @@ class Handler(BaseHTTPRequestHandler):
duration_ms = round((time.time() - getattr(self, '_req_t0', time.time())) * 1000, 1)
record = _json.dumps({
'ts': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()),
'method': self.command or '-',
'path': self.path or '-',
'method': getattr(self, 'command', None) or '-',
'path': getattr(self, 'path', None) or '-',
'status': int(code) if str(code).isdigit() else code,
'ms': duration_ms,
})