-
{% for f in p.ordered_flags %}
-
- @{{f.user.username}}{% if f.reason %}: {{f.reason}}{% endif %} +
- @{{f.user.username}}{% if f.reason %}: {{f.reason | safe}}{% endif %} {% endfor %}
diff --git a/files/__main__.py b/files/__main__.py index ffc6bd4f3..58a6f5927 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -254,19 +254,13 @@ def after_request(response): print(e) abort(500) - response.headers.add('Access-Control-Allow-Headers', - "Origin, X-Requested-With, Content-Type, Accept, x-auth" - ) + response.headers.add('Access-Control-Allow-Headers', "Origin, X-Requested-With, Content-Type, Accept, x-auth") response.headers.remove("Cache-Control") - response.headers.add("Cache-Control", - "public, maxage=600") + response.headers.add("Cache-Control", "public, maxage=600") response.headers.add("Strict-Transport-Security", "max-age=31536000") response.headers.add("Referrer-Policy", "same-origin") - response.headers.add("Feature-Policy", - "geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment 'none';") - if not request.path.startswith("/embed/"): - response.headers.add("X-Frame-Options", - "deny") + response.headers.add("Feature-Policy", "geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment 'none';") + if not request.path.startswith("/embed/"): response.headers.add("X-Frame-Options", "deny") return response diff --git a/files/routes/comments.py b/files/routes/comments.py index e62242177..b2b0d3f9b 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -8,7 +8,7 @@ from files.helpers.images import * from files.helpers.session import * from files.classes import * from files.routes.front import comment_idlist -from pusher_push_notifications import PushNotifications, PusherAuthError +from pusher_push_notifications import PushNotifications from flask import * from files.__main__ import app, limiter @@ -550,11 +550,8 @@ def api_comment(v): }, }, ) - except PusherAuthError as e: - sys.stderr.write(traceback.format_exc()) - sys.stderr.flush() - - + except Exception as e: + print(e) diff --git a/files/routes/posts.py b/files/routes/posts.py index 59fa50dcc..0a4937b67 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -787,7 +787,8 @@ def submit_post(v): url = url.replace(rd, "https://old.reddit.com/") url = url.replace("https://mobile.twitter.com", "https://twitter.com") - + if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"): + url = url.replace("https://streamable.com/", "https://streamable.com/e/") # if url.startswith("https://old.reddit.com/") and '/comments/' in url and '?' not in url: url += "?sort=controversial" title_html = sanitize(title, linkgen=True, flair=True) diff --git a/files/routes/users.py b/files/routes/users.py index 985a02bc5..938d60e10 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -11,7 +11,7 @@ from files.helpers.markdown import * from files.mail import * from flask import * from files.__main__ import app, limiter -from pusher_push_notifications import PushNotifications, PusherAuthError +from pusher_push_notifications import PushNotifications site = environ.get("DOMAIN").strip() @@ -194,9 +194,8 @@ def message2(v, username): }, }, ) - except PusherAuthError as e: - sys.stderr.write(traceback.format_exc()) - sys.stderr.flush() + except Exception as e: + print(e) return redirect('/notifications?all=true') diff --git a/files/templates/badges.html b/files/templates/badges.html index 7982aa2e4..1877cccf9 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -10,6 +10,7 @@