mirror of
https://github.com/simon987/od-database.git
synced 2025-12-13 14:59:02 +00:00
Added filter to check if a website can be scanned from its parent directory
This commit is contained in:
9
app.py
9
app.py
@@ -322,8 +322,12 @@ def submit():
|
||||
|
||||
def try_enqueue(url):
|
||||
url = os.path.join(url, "")
|
||||
website = db.get_website_by_url(url)
|
||||
url = od_util.get_top_directory(url)
|
||||
|
||||
if not od_util.is_valid_url(url):
|
||||
return "<strong>Error:</strong> Invalid url. Make sure to include the appropriate scheme.", "warning"
|
||||
|
||||
website = db.get_website_by_url(url)
|
||||
if website:
|
||||
return "Website already exists", "danger"
|
||||
|
||||
@@ -331,9 +335,6 @@ def try_enqueue(url):
|
||||
if website:
|
||||
return "A parent directory of this url has already been posted", "danger"
|
||||
|
||||
if not od_util.is_valid_url(url):
|
||||
return "<strong>Error:</strong> Invalid url. Make sure to include the appropriate scheme.", "danger"
|
||||
|
||||
if db.is_blacklisted(url):
|
||||
return "<strong>Error:</strong> " \
|
||||
"Sorry, this website has been blacklisted. If you think " \
|
||||
|
||||
Reference in New Issue
Block a user