fix: Only search for SLD
All checks were successful
Build Docker / Build Main Image (push) Successful in 20s
Build Docker / Build SLDs Image (push) Successful in 20s

This commit is contained in:
Nathan Woodburn 2023-11-08 20:49:03 +11:00
parent c0193337bb
commit 923858e47f
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 2 additions and 11 deletions

View File

@ -23,15 +23,5 @@ def get_website_data(domain):
connection.close()
if data == []:
# Create new entry
connection = mysql.connector.connect(**dbargs)
cursor = connection.cursor()
cursor.execute("""
INSERT INTO site (domain, data)
VALUES (%s, %s)
""", (domain, ""))
connection.commit()
cursor.close()
connection.close()
return ""
return data[0][2]

View File

@ -24,8 +24,9 @@ def error(message):
@app.route('/')
def index():
host = request.host
if len(host.split('.')) < 2:
if len(host.split('.')) != 2:
return error('Invalid domain')
host = host.split('.')[0]
# Get website data
data = db.get_website_data(host)