mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-09 17:27:27 +08:00
[Enhance] Add limiter & Building API
- Add a custom limiter and use it for limiting users' download instead of using database > So add a requirement `limits`. - Fix a character's value - Change the email max length to 64 - Change something about API's roles and powers - Add an API endpoint for getting users' roles and powers
This commit is contained in:
@@ -63,10 +63,10 @@ def download(file_path):
|
||||
x.select_for_check()
|
||||
if x.is_limited:
|
||||
raise ArcError(
|
||||
'You have reached the download limit.', 903, status=403)
|
||||
'You have reached the download limit.', 903, status=429)
|
||||
if not x.is_valid:
|
||||
raise ArcError('Expired token.', status=403)
|
||||
x.insert_user_download()
|
||||
x.download_hit()
|
||||
# response = make_response()
|
||||
# response.headers['Content-Type'] = 'application/octet-stream'
|
||||
# response.headers['X-Accel-Redirect'] = '/nginx_download/' + file_path
|
||||
|
||||
Reference in New Issue
Block a user