fix cookies
This commit is contained in:
parent
d4a38bbf6f
commit
836f294ef6
5
app.py
5
app.py
@ -16,6 +16,9 @@ app = Flask(__name__)
|
||||
# Use a raw string for the default FILE_ROOT path.
|
||||
app.config['FILE_ROOT'] = r'/mp3_root'
|
||||
app.config['SECRET_KEY'] = '85c1117eb3a5f2c79f0ff395bada8ff8d9a257b99ef5e143'
|
||||
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=90)
|
||||
app.config['SESSION_COOKIE_SAMESITE'] = 'None'
|
||||
app.config['SESSION_COOKIE_SECURE'] = True
|
||||
|
||||
def load_allowed_secrets(filename='allowed_secrets.json'):
|
||||
with open(filename) as f:
|
||||
@ -272,7 +275,7 @@ def serve_file(filename):
|
||||
if not os.path.isfile(full_path):
|
||||
app.logger.error(f"File not found: {full_path}")
|
||||
return "File not found", 404
|
||||
|
||||
|
||||
# Exclude HEAD requests from logging
|
||||
if request.method != 'HEAD':
|
||||
log_file_access(full_path)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user