Merge commit 'c357a7f8d697ede4df4be74456b0497118c9d049' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2025-06-30 17:52:22 +02:00
commit 2eec4da8fc
154 files changed
+1168 -826

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ module Mastodon
# Convert smtp settings from environment variables (or defaults in
# `config/email.yml`) into the format that `ActionMailer` understands
def smtp_settings(config)
def convert_smtp_settings(config)
enable_starttls = nil
enable_starttls_auto = nil
@@ -22,12 +22,11 @@ module Mastodon
status, headers, response = file
# Set cache headers on static files. Some paths require different cache headers
headers['Cache-Control'] = begin
request_path = env['REQUEST_PATH']
if request_path.start_with?('/sw.js')
request = Rack::Request.new env
headers['cache-control'] = begin
if request.path.start_with?('/sw.js')
"public, max-age=#{SERVICE_WORKER_TTL}, must-revalidate"
elsif request_path.start_with?(paperclip_root_url)
elsif request.path.start_with?(paperclip_root_url)
"public, max-age=#{CACHE_TTL}, immutable"
else
"public, max-age=#{CACHE_TTL}, must-revalidate"
@@ -35,9 +34,9 @@ module Mastodon
end
# Override the default CSP header set by the CSP middleware
headers['Content-Security-Policy'] = "default-src 'none'; form-action 'none'" if request_path.start_with?(paperclip_root_url)
headers['content-security-policy'] = "default-src 'none'; form-action 'none'" if request.path.start_with?(paperclip_root_url)
headers['X-Content-Type-Options'] = 'nosniff'
headers['x-content-type-options'] = 'nosniff'
[status, headers, response]
end