诚实性修复: API限流Retry-After(wait=60s)+断言 / purge定时接线(04:00 cron+actor+测试) / Channel表单校验(ref+rules+validate) / README PG数字513
This commit is contained in:
@@ -101,7 +101,7 @@ def test_handler_returns_structured_500_for_unknown(db):
|
||||
resp = _call(RuntimeError("内部数据库连接串 postgres://user:pw@host/db 泄露了"))
|
||||
assert resp.status_code == 500
|
||||
assert resp.data["code"] == "server_error"
|
||||
assert resp.data["exc_type"] == "RuntimeError"
|
||||
assert "exc_type" not in resp.data
|
||||
body = str(resp.data)
|
||||
assert "postgres://" not in body # 原始消息不外泄
|
||||
assert "Traceback" not in body
|
||||
|
||||
Reference in New Issue
Block a user