aboutsummaryrefslogtreecommitdiff
path: root/_wui
diff options
context:
space:
mode:
Diffstat (limited to '_wui')
-rw-r--r--_wui/awwan.ts22
-rw-r--r--_wui/main.js8
2 files changed, 3 insertions, 27 deletions
diff --git a/_wui/awwan.ts b/_wui/awwan.ts
index 6e6bbc2..8ee224a 100644
--- a/_wui/awwan.ts
+++ b/_wui/awwan.ts
@@ -23,7 +23,7 @@ const ID_VFS = "com_vfs";
const ID_VFS_PATH = "vfs_path";
const ID_OUTPUT = "output";
const ID_OUTPUT_WRAPPER = "output_wrapper";
-const MAX_FILE_SIZE = 3000000;
+const MAX_FILE_SIZE = 102400; // 100KB
interface RequestInterface {
mode: string;
@@ -360,26 +360,10 @@ export class Awwan {
message: "",
};
- let isTypeAllowed = false;
- if (
- node.content_type &&
- (node.content_type.indexOf("json") >= 0 ||
- node.content_type.indexOf("message") >= 0 ||
- node.content_type.indexOf("octet-stream") >= 0 ||
- node.content_type.indexOf("script") >= 0 ||
- node.content_type.indexOf("text") >= 0 ||
- node.content_type.indexOf("xml") >= 0)
- ) {
- isTypeAllowed = true;
- }
- if (!isTypeAllowed) {
- res.message = `The file "${node.name}" with content type "${node.content_type}" is not allowed to be opened`;
- return res;
- }
if (node.size && node.size > MAX_FILE_SIZE) {
res.message = `The file "${node.name}" with size ${
- node.size / 1000000
- }MB is greater than maximum ${MAX_FILE_SIZE / 1000000}MB.`;
+ node.size / 1024
+ }KB is greater than maximum ${MAX_FILE_SIZE / 1000}KB.`;
return res;
}
res.code = 200;
diff --git a/_wui/main.js b/_wui/main.js
index 929774d..7fdcddf 100644
--- a/_wui/main.js
+++ b/_wui/main.js
@@ -732,14 +732,6 @@ var awwan = (() => {
code: 412,
message: ""
};
- let isTypeAllowed = false;
- if (node.content_type && (node.content_type.indexOf("json") >= 0 || node.content_type.indexOf("message") >= 0 || node.content_type.indexOf("octet-stream") >= 0 || node.content_type.indexOf("script") >= 0 || node.content_type.indexOf("text") >= 0 || node.content_type.indexOf("xml") >= 0)) {
- isTypeAllowed = true;
- }
- if (!isTypeAllowed) {
- res2.message = `The file "${node.name}" with content type "${node.content_type}" is not allowed to be opened`;
- return res2;
- }
if (node.size && node.size > MAX_FILE_SIZE) {
res2.message = `The file "${node.name}" with size ${node.size / 1e6}MB is greater than maximum ${MAX_FILE_SIZE / 1e6}MB.`;
return res2;