fix(schema): revert 200->None replacement feature
go-sqlite3 used in server can not process NULLs
This commit is contained in:
parent
74e6771fd3
commit
95f280663b
1 changed files with 2 additions and 2 deletions
4
addon.py
4
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}')
|
||||
|
|
Loading…
Reference in a new issue