diff options
author | Ernst Widerberg <ernst@sunet.se> | 2021-11-24 15:25:15 +0100 |
---|---|---|
committer | Ernst Widerberg <ernst@sunet.se> | 2021-11-24 15:25:15 +0100 |
commit | ec87ccf56d3f95f79ba07ca96d6cb2464a698657 (patch) | |
tree | 1560171405bcd7c38616d05fb1cedf7a6d7536a3 /src/main.py | |
parent | 2d594c65761c3e069a1ee50b7fac8ffec8e15081 (diff) |
Add mock X-Total-Count
Diffstat (limited to 'src/main.py')
-rwxr-xr-x | src/main.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.py b/src/main.py index 4d20c84..ba2508d 100755 --- a/src/main.py +++ b/src/main.py @@ -22,6 +22,13 @@ app.add_middleware( allow_headers=["*"], ) +# TODO: X-Total-Count +@app.middleware("http") +async def mock_x_total_count_header(request: Request, call_next): + response = await call_next(request) + response.headers["X-Total-Count"] = 100 + return response + for i in range(10): try: db = DictDB() |