Skip to content
Snippets Groups Projects
Verified Commit f087a031 authored by Jonas Leder's avatar Jonas Leder
Browse files

don't return qr image

parent c403602e
No related branches found
No related tags found
No related merge requests found
from flask import jsonify, render_template
from sqlite3 import connect
from makeqr import makeQR
def apiGet(request, url_scheme, s, sAPI, passwordProtected):
try:
......@@ -72,16 +71,6 @@ 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"
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment