mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
allow_sql config option to disable custom SQL, closes #284
This commit is contained in:
parent
50920cfe3d
commit
f722b0a730
7 changed files with 53 additions and 7 deletions
|
|
@ -11,6 +11,8 @@ class DatabaseView(BaseView):
|
|||
|
||||
async def data(self, request, name, hash):
|
||||
if request.args.get("sql"):
|
||||
if not self.ds.config["allow_sql"]:
|
||||
raise DatasetteError("sql= is not allowed", status=400)
|
||||
sql = request.raw_args.pop("sql")
|
||||
validate_sql_select(sql)
|
||||
return await self.custom_sql(request, name, hash, sql)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue