From f087a0310e574ca1a4db1b38d5420fd2cf89c88f Mon Sep 17 00:00:00 2001 From: Jonas Leder <jonas@jonasled.de> Date: Mon, 28 Feb 2022 20:34:09 +0100 Subject: [PATCH] don't return qr image --- app/api.py | 19 ++++--------------- app/templates/apiDocs.html | 8 -------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/app/api.py b/app/api.py index ebc4455..d8d5dd2 100644 --- a/app/api.py +++ b/app/api.py @@ -1,6 +1,5 @@ from flask import jsonify, render_template from sqlite3 import connect -from makeqr import makeQR def apiGet(request, url_scheme, s, sAPI, passwordProtected): try: @@ -72,20 +71,10 @@ def apiPost(request, url_scheme, domain, sAPI, passwordProtected, password): 'INSERT INTO WEB_URL (LONG_URL, SHORT_URL, USERNAME) VALUES (?, ?, ?)', [longURL, short, username] ) - try: - request.form['qr'] - qr64 = "data:image/jpeg;base64," + makeQR(url_scheme + "://" + short) - - return jsonify( - status="0", - message="ok", - qr=qr64 - ) - except: - return jsonify( - status="0", - message="ok" - ) + return jsonify( + status="0", + message="ok" + ) else: return jsonify( status="4", diff --git a/app/templates/apiDocs.html b/app/templates/apiDocs.html index 915e9b4..2d5c869 100644 --- a/app/templates/apiDocs.html +++ b/app/templates/apiDocs.html @@ -56,7 +56,6 @@ <ul> <li>short: the short URL you want to get. example: {{domain}}/example</li> <li>long: the long URL you want to short</li> - <li>qr: if you add this parameter you will get an base64 encoded QR code image</li> <li>apikey: you can add this argument, if you want to assign this link to your account.</li> {% if passwordProtected %} <li>password: this value contains the password, that is needed to short a link.</li> @@ -69,7 +68,6 @@ <ul> <li>status: The status code of the reponse. Down there is a table with the posible response codes</li> <li>message: This argument will do the same like the status code, but it is written out, for reading by human.</li> - <li>qr: If you enabled this argument, the response will include a QR code of the shorten link as base64 coded jpeg image</li> </ul> <br> @@ -107,10 +105,4 @@ {% endif %} </table> - - <br> - <h2>Preview image</h2> - <p>Please paste your base64 image here: <input type="text" id="base64Input"> <button onclick='document.getElementById("base64Image").src = document.getElementById("base64Input").value;'>show</button><br> - <smaller>(this will not work very well in google Chrome)</smaller></p> - <img id="base64Image"> </body> \ No newline at end of file -- GitLab