Bugfixes
This commit is contained in:
+1
-15
@@ -41,21 +41,6 @@ async function localGet({ options, dbSchema }) {
|
||||
const tableName = options?.tableName ? options.tableName : undefined;
|
||||
const dbFullName = process.env.DSQL_DB_NAME || "";
|
||||
|
||||
/**
|
||||
* Input Validation
|
||||
*
|
||||
* @description Input Validation
|
||||
*/
|
||||
if (
|
||||
typeof query == "string" &&
|
||||
(query.match(
|
||||
/^alter|^delete|information_schema|databases|^create/i
|
||||
) ||
|
||||
!query.match(/^select|^\( ?select/i))
|
||||
) {
|
||||
return { success: false, msg: "Wrong Input" };
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new user folder and file
|
||||
*
|
||||
@@ -71,6 +56,7 @@ async function localGet({ options, dbSchema }) {
|
||||
dbSchema,
|
||||
tableName,
|
||||
local: true,
|
||||
readOnly: true,
|
||||
});
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
@@ -21,25 +21,6 @@ async function localPost({ options, dbSchema }) {
|
||||
const { query, tableName, queryValues } = options;
|
||||
const dbFullName = process.env.DSQL_DB_NAME || "";
|
||||
|
||||
/**
|
||||
* Input Validation
|
||||
*
|
||||
* @description Input Validation
|
||||
*/
|
||||
if (
|
||||
typeof query === "string" &&
|
||||
query?.match(/^create |^alter |^drop /i)
|
||||
) {
|
||||
return { success: false, msg: "Wrong Input" };
|
||||
}
|
||||
|
||||
if (
|
||||
typeof query === "object" &&
|
||||
query?.action?.match(/^create |^alter |^drop /i)
|
||||
) {
|
||||
return { success: false, msg: "Wrong Input" };
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new user folder and file
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user