6 次代碼提交 a5a43c375a ... f19f3c80ff

作者 SHA1 備註 提交日期
  tinyrabbit a5a43c375a Merge branch 'fix-url-decoding' of zertbert/gemini-antenna into master 5 月之前
  zertbert a09e3dde29 Clean up direct-ingestion.py 7 月之前
  zertbert 362ac8ddd6 Undo changes to /submit 7 月之前
  zertbert 1396dc2872 Don't add duplicate rules 7 月之前
  zertbert a33c6d1baa Fix double-unquoting when adding a filter 7 月之前
  zertbert 5593cab991 Decode URLs for submit and removing filters 7 月之前
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      customFilters.py

+ 2 - 3
customFilters.py

@@ -7,6 +7,7 @@ from os import getenv
 from os.path import exists
 import string
 import random
+import URLHelper
 import antennaDB
 import signoffs
 
@@ -41,14 +42,12 @@ else:
     rules = list(filter(("").__ne__, rules))
     rules.pop(0)
     affectedRule = getenv('QUERY_STRING')
-    affectedRule = unquote(affectedRule)
 
     if filterFilePathParts[-1] == "add":
         if not affectedRule:
             print("10 Rule to add:\r\n")
         else:
-            if affectedRule not in rules:
-                rules.insert(0, affectedRule)
+            rules.insert(0,unquote(affectedRule))
             print("30 gemini://"+getenv('SERVER_NAME')+getenv('SCRIPT_NAME')+"/"+filterFilePathParts[0]+"\r\n")
 
     elif filterFilePathParts[-1] == "remove":