Merge branch 'develop' into 1305_receive_messages

This commit is contained in:
Micah Lee 2021-04-29 16:58:33 -07:00
commit 343e1be3d0
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
21 changed files with 367 additions and 84 deletions

View file

@ -18,12 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from flask import (
request,
render_template,
make_response,
jsonify,
session)
from flask import request, render_template, make_response, jsonify, session
from flask_socketio import emit, join_room, leave_room
@ -72,6 +67,7 @@ class ChatModeWeb:
"chat.html",
static_url_path=self.web.static_url_path,
username=session.get("name"),
title=self.web.settings.get("general", "title"),
)
)
return self.web.add_security_headers(r)

View file

@ -79,6 +79,7 @@ class ReceiveModeWeb:
static_url_path=self.web.static_url_path,
disable_text=self.web.settings.get("receive", "disable_text"),
disable_files=self.web.settings.get("receive", "disable_files"),
title=self.web.settings.get("general", "title"),
)
)
return self.web.add_security_headers(r)
@ -234,6 +235,7 @@ class ReceiveModeWeb:
"new_body": render_template(
"thankyou.html",
static_url_path=self.web.static_url_path,
title=self.web.settings.get("general", "title"),
)
}
)
@ -242,6 +244,7 @@ class ReceiveModeWeb:
r = make_response(
render_template("thankyou.html"),
static_url_path=self.web.static_url_path,
title=self.web.settings.get("general", "title"),
)
return self.web.add_security_headers(r)

View file

@ -390,6 +390,7 @@ class ShareModeWeb(SendBaseModeWeb):
is_zipped=self.is_zipped,
static_url_path=self.web.static_url_path,
download_individual_files=self.download_individual_files,
title=self.web.settings.get("general", "title"),
)
)

View file

@ -310,7 +310,7 @@ class Web:
if not self.settings.get("website", "disable_csp") or self.mode != "website":
r.headers.set(
"Content-Security-Policy",
"default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self' data:;",
"default-src 'self'; frame-ancestors 'none'; form-action 'self'; base-uri 'self'; img-src 'self' data:;",
)
return r

View file

@ -60,6 +60,7 @@ class WebsiteModeWeb(SendBaseModeWeb):
breadcrumbs=breadcrumbs,
breadcrumbs_leaf=breadcrumbs_leaf,
static_url_path=self.web.static_url_path,
title=self.web.settings.get("general", "title"),
)
)