Add packages API

This commit is contained in:
rubenwardy
2018-03-23 17:33:34 +00:00
parent 2a836c1000
commit 269c8c0eb4
4 changed files with 43 additions and 12 deletions

9
app/views/utils.py Normal file
View File

@@ -0,0 +1,9 @@
from flask import request
def isFilenameAllowed(filename, exts):
return "." in filename and \
filename.rsplit(".", 1)[1].lower() in exts
def shouldReturnJson():
return "application/json" in request.accept_mimetypes and \
not "text/html" in request.accept_mimetypes