diff --git a/db/urls.db b/db/urls.db index 50edbbb751eec0f1ae8b0c4c59f82d5fe12acf61..d3d43b01a585b8130f418f819126729ed47aad11 100644 Binary files a/db/urls.db and b/db/urls.db differ diff --git a/main.py b/main.py index c259f67ae2effb5ceef1057c0458a1312f89a44e..5e437ac2681a751f3f61a73afaba0049c39f4871 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,6 @@ import sqlite3 from urllib.parse import urlparse import os -str_encode = str.encode app = Flask(__name__) domain_to_index = {} domain_prepared = "" @@ -48,7 +47,7 @@ def table_check(): def home(): host = request.headers['Host'] #Get the domain, the client uses from the Header if request.method == 'POST': #Post will be executed if the client inserts a new entry - url = str_encode(request.form.get('url')) + url = str.encode(request.form.get('url')) with sqlite3.connect('db/urls.db') as conn: #Check if another user already used the short link cursor = conn.cursor() res = cursor.execute('SELECT LONG_URL FROM WEB_URL WHERE SHORT_URL=?', [request.form.get('domain') + "/" + request.form.get('short')])