removed comment that messes up the injection logic

This commit is contained in:
2025-11-05 17:15:29 +01:00
parent bec3d5a0ea
commit bfda3746fd
3 changed files with 41 additions and 42 deletions

View File

@@ -44,7 +44,7 @@ from .utils import (
main = Blueprint('main', __name__)
slidev_deck_pattern = re.compile(r"^\/slides\/[^\/]+\/\d*(?:\?.*)?$")
slidev_deck_pattern = re.compile(r"^\/slides\/[^\/]+\/[^\/]+\/(?:\d+|index\.html)(?:\?.*)?$")
slidev_all_pattern = re.compile(r"^\/slides\/([^\/]+)\/([^\/]+)(?:\/presenter)?\/(\d+)(?:\?.*)?$")
@socketio.on("connect")
@@ -54,8 +54,8 @@ def on_connect():
@main.after_request
def inject_confused_button(response):
if True:
if (slidev_deck_pattern.match(request.path) or request.path == '/') and response.content_type.startswith('text/html') and not flask_login.current_user.is_authenticated :
print("** INJECTION TEST PASSED **")
if response.direct_passthrough:
response.direct_passthrough = False
body = response.get_data(as_text=True)

View File

@@ -9,7 +9,6 @@
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<!-- in base.html, in <head> or just before </body> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.7.1/socket.io.min.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.10"></script>

View File

@@ -3,4 +3,4 @@ from app import create_app, socketio
app = create_app()
if __name__ == '__main__':
socketio.run(app, host="0.0.0.0", port=5000, debug=True)
socketio.run(app, port=5000, debug=True)