run: add dummy ratelimiting handler

This commit is contained in:
Luna Mendes 2018-11-03 22:48:36 -03:00
parent 69fbd9c117
commit b17cfd46eb
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,5 @@
from quart import current_app as app, request
async def ratelimit_handler():
# dummy handler for future code
print(request.headers)

7
run.py
View File

@ -15,6 +15,8 @@ from litecord.blueprints import (
voice, invites, relationships, dms
)
from litecord.ratelimits.main import ratelimit_handler
# those blueprints are separated from the "main" ones
# for code readability if people want to dig through
# the codebase.
@ -87,6 +89,11 @@ for bp, suffix in bps.items():
app.register_blueprint(bp, url_prefix=f'/api/v6{suffix}')
@app.before_request
async def app_before_request():
await ratelimit_handler()
@app.after_request
async def app_after_request(resp):
origin = request.headers.get('Origin', '*')