Add 8 new tools: Hash Verifier, URL Tool, String Utils, Cron Explainer, IP Calc, Lorem Ipsum, CSV Viewer, Notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
from flask import Blueprint, request, jsonify
|
||||
from urllib.parse import quote, unquote
|
||||
from util.logger import logger
|
||||
from auth.token import verify_token
|
||||
|
||||
url_blueprint = Blueprint('url_tool', __name__)
|
||||
|
||||
|
||||
@url_blueprint.route('/api/url/encode', methods=['POST'])
|
||||
def url_encode():
|
||||
user = verify_token()
|
||||
if not user:
|
||||
return jsonify({"message": "Nicht autorisiert"}), 401
|
||||
try:
|
||||
data = request.get_json() or {}
|
||||
text = data.get("text", "")
|
||||
result = quote(text, safe='')
|
||||
return jsonify({"result": result})
|
||||
except Exception as e:
|
||||
logger.error(f"Fehler URL encode: {e}")
|
||||
return jsonify({"message": "Fehler beim Encoding"}), 500
|
||||
|
||||
|
||||
@url_blueprint.route('/api/url/decode', methods=['POST'])
|
||||
def url_decode():
|
||||
user = verify_token()
|
||||
if not user:
|
||||
return jsonify({"message": "Nicht autorisiert"}), 401
|
||||
try:
|
||||
data = request.get_json() or {}
|
||||
text = data.get("text", "")
|
||||
result = unquote(text)
|
||||
return jsonify({"result": result})
|
||||
except Exception as e:
|
||||
logger.error(f"Fehler URL decode: {e}")
|
||||
return jsonify({"message": "Fehler beim Decoding"}), 500
|
||||
Reference in New Issue
Block a user