summarylogtreecommitdiffstats
path: root/antsword-2.1.14.patch
blob: c100f9da06812279de698f9461b90eb62e1df92e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
This patch removes trivial and duplicate codes.
diff '--color=auto' -u0 -r old/modules/config.js new/modules/config.js
--- old/modules/config.js	2021-05-14 18:15:46.000000000 -0700
+++ new/modules/config.js	2021-06-15 04:10:20.882275457 -0700
@@ -17,2 +16,0 @@
-    // 旧数据存储目录
-    let _oldPath = path.join(process.env.HOME || process.env.LOCALAPPPATH || process.cwd() || '.', '.antSword', 'shell.db');
@@ -20 +18 @@
-    this.basePath = path.join(process.env.AS_WORKDIR, 'antData')
+    this.basePath = path.join(process.env.HOME || process.env.LOCALAPPPATH || process.cwd() || '.', '.antSword');
@@ -25,4 +22,0 @@
-    // 旧数据搬迁
-    if (fs.existsSync(_oldPath) && !fs.existsSync(this.dataPath)) {
-      fs.writeFileSync(this.dataPath, fs.readFileSync(_oldPath))
-    }
@@ -90,4 +83,0 @@
-  get urlblacklist() {
-    return /(gov.cn|edu.cn)/
-  }
-
diff '--color=auto' -u0 -r old/modules/database.js new/modules/database.js
--- old/modules/database.js	2021-05-14 18:15:46.000000000 -0700
+++ new/modules/database.js	2021-06-15 04:15:31.177348333 -0700
@@ -148,4 +147,0 @@
-    if (opts.base['url'].match(CONF.urlblacklist)) {
-      event.returnValue = "Blacklist URL"
-      return
-    }
@@ -192,4 +187,0 @@
-    if (_new.base['url'].match(CONF.urlblacklist)) {
-      event.returnValue = "Blacklist URL"
-      return
-    }
diff '--color=auto' -u0 -r old/modules/request.js new/modules/request.js
--- old/modules/request.js	2021-05-14 18:15:46.000000000 -0700
+++ new/modules/request.js	2021-06-15 04:26:08.089386230 -0700
@@ -74,5 +73,0 @@
-    if (opts['url'].match(CONF.urlblacklist)) {
-      return event
-        .sender
-        .send('request-error-' + opts['hash'], "Blacklist URL");
-    }
@@ -108,5 +102,0 @@
-    if (opts['url'].match(CONF.urlblacklist)) {
-      return event
-        .sender
-        .send('request-error-' + opts['hash'], "Blacklist URL");
-    }
@@ -284,5 +273,0 @@
-    if (opts['url'].match(CONF.urlblacklist)) {
-      return event
-        .sender
-        .send('request-error-' + opts['hash'], "Blacklist URL");
-    }