fix: Remove strict slashes from index routes
All checks were successful
Build Docker / BuildImage (push) Successful in 48s
All checks were successful
Build Docker / BuildImage (push) Successful in 48s
This commit is contained in:
@@ -30,7 +30,7 @@ if 'time-zone' not in NC_CONFIG:
|
|||||||
NC_CONFIG['time-zone'] = 10
|
NC_CONFIG['time-zone'] = 10
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/", strict_slashes=False)
|
||||||
@app.route("/help")
|
@app.route("/help")
|
||||||
def help():
|
def help():
|
||||||
"""Provide API documentation and help."""
|
"""Provide API documentation and help."""
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ def render_home(handshake_scripts: str | None = None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/", strict_slashes=False)
|
||||||
def index():
|
def index():
|
||||||
if not isCLI(request):
|
if not isCLI(request):
|
||||||
return render_home(handshake_scripts=getHandshakeScript(request.host))
|
return render_home(handshake_scripts=getHandshakeScript(request.host))
|
||||||
|
|||||||
@@ -122,4 +122,10 @@ def sol_donate_post(amount):
|
|||||||
return jsonify({"message": "Error: Amount too small"}), 400, SOLANA_HEADERS
|
return jsonify({"message": "Error: Amount too small"}), 400, SOLANA_HEADERS
|
||||||
|
|
||||||
transaction = create_transaction(sender, amount)
|
transaction = create_transaction(sender, amount)
|
||||||
return jsonify({"message": "Success", "transaction": transaction}), 200, SOLANA_HEADERS
|
return jsonify({"message": "Success", "transaction": transaction}), 200, SOLANA_HEADERS
|
||||||
|
|
||||||
|
@app.route("/actions.json")
|
||||||
|
def sol_actions():
|
||||||
|
return jsonify(
|
||||||
|
{"rules": [{"pathPattern": "/donate**", "apiPath": "/api/v1/donate**"}]}
|
||||||
|
)
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ def callback():
|
|||||||
print("Refresh Token:", REFRESH_TOKEN)
|
print("Refresh Token:", REFRESH_TOKEN)
|
||||||
return redirect(url_for("spotify.currently_playing"))
|
return redirect(url_for("spotify.currently_playing"))
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/", strict_slashes=False)
|
||||||
@app.route("/playing")
|
@app.route("/playing")
|
||||||
def currently_playing():
|
def currently_playing():
|
||||||
"""Public endpoint showing your current track."""
|
"""Public endpoint showing your current track."""
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ from tools import json_response
|
|||||||
app = Blueprint('template', __name__)
|
app = Blueprint('template', __name__)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/", strict_slashes=False)
|
||||||
def index():
|
def index():
|
||||||
return json_response(request, "Success", 200)
|
return json_response(request, "Success", 200)
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
from flask import Blueprint, render_template, make_response, request, jsonify, send_from_directory, redirect
|
from flask import Blueprint, make_response, request, jsonify, send_from_directory, redirect
|
||||||
|
from tools import error_response
|
||||||
import os
|
import os
|
||||||
|
|
||||||
app = Blueprint('well-known', __name__, url_prefix='/.well-known')
|
app = Blueprint('well-known', __name__, url_prefix='/.well-known')
|
||||||
@@ -25,7 +26,7 @@ def wallets(path):
|
|||||||
if os.path.isfile(".well-known/wallets/" + path.upper()):
|
if os.path.isfile(".well-known/wallets/" + path.upper()):
|
||||||
return redirect("/.well-known/wallets/" + path.upper(), code=302)
|
return redirect("/.well-known/wallets/" + path.upper(), code=302)
|
||||||
|
|
||||||
return render_template("404.html"), 404
|
return error_response(request)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/nostr.json")
|
@app.route("/nostr.json")
|
||||||
|
|||||||
@@ -179,7 +179,6 @@ def serviceWorker():
|
|||||||
|
|
||||||
# region Misc routes
|
# region Misc routes
|
||||||
|
|
||||||
|
|
||||||
@app.route("/meet")
|
@app.route("/meet")
|
||||||
@app.route("/meeting")
|
@app.route("/meeting")
|
||||||
@app.route("/appointment")
|
@app.route("/appointment")
|
||||||
@@ -203,13 +202,6 @@ def api_legacy(function):
|
|||||||
return redirect(f"/api/v1/{function}", code=301)
|
return redirect(f"/api/v1/{function}", code=301)
|
||||||
return error_response(request, message="404 Not Found", code=404)
|
return error_response(request, message="404 Not Found", code=404)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/actions.json")
|
|
||||||
def sol_actions():
|
|
||||||
return jsonify(
|
|
||||||
{"rules": [{"pathPattern": "/donate**", "apiPath": "/api/v1/donate**"}]}
|
|
||||||
)
|
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
# region Main routes
|
# region Main routes
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Contact [/contact]
|
|||||||
Projects [/projects]
|
Projects [/projects]
|
||||||
Tools [/tools]
|
Tools [/tools]
|
||||||
Donate [/donate]
|
Donate [/donate]
|
||||||
API [/api/v1/]
|
API [/api/v1]
|
||||||
|
|
||||||
[1;36m───────────────────────────────────────────────[0m
|
[1;36m───────────────────────────────────────────────[0m
|
||||||
[1;36m ABOUT ME [0m
|
[1;36m ABOUT ME [0m
|
||||||
|
|||||||
Reference in New Issue
Block a user