From 95f280663bda41475c0b99fbcd080aa07a021441 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 2 Jul 2024 19:35:41 +0400 Subject: [PATCH] fix(schema): revert 200->None replacement feature go-sqlite3 used in server can not process NULLs --- addon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addon.py b/addon.py index 259c595..b9e0482 100644 --- a/addon.py +++ b/addon.py @@ -18,7 +18,7 @@ with db as conn: id integer primary key, method text not null default "GET", url text not null, - code integer default null + code integer not null default 200 ); ''') @@ -35,7 +35,7 @@ def response(flow: HTTPFlow) -> None: code = flow.response.status_code cur = conn.execute( 'insert into data (method, url, code) values (?, ?, ?) returning id', - (req.method, url, code if code != 200 else None), + (req.method, url, code), ) uid = cur.fetchone()[0] path = os.path.join(storage, f'{uid}')