mirror of
https://github.com/janeczku/calibre-web
synced 2025-11-07 18:54:03 +00:00
Add rate limit for opds
This commit is contained in:
@@ -18,9 +18,14 @@
|
||||
|
||||
import sys
|
||||
|
||||
from . import create_app
|
||||
from . import create_app, limiter
|
||||
from .jinjia import jinjia
|
||||
from .remotelogin import remotelogin
|
||||
from flask import request
|
||||
|
||||
|
||||
def request_username():
|
||||
return request.authorization.username
|
||||
|
||||
def main():
|
||||
app = create_app()
|
||||
@@ -56,6 +61,7 @@ def main():
|
||||
app.register_blueprint(tasks)
|
||||
app.register_blueprint(web)
|
||||
app.register_blueprint(opds)
|
||||
limiter.limit("10/minute",key_func=request_username)(opds)
|
||||
app.register_blueprint(jinjia)
|
||||
app.register_blueprint(about)
|
||||
app.register_blueprint(shelf)
|
||||
|
||||
Reference in New Issue
Block a user