An attempt to prevent caching and bypassing CAPTCHA

This commit is contained in:
Tracker-Friendly 2023-11-19 11:32:56 +00:00
parent f44cdfa456
commit 8ba3a8fcea
1 changed files with 4 additions and 1 deletions

5
app.py
View File

@ -1,4 +1,4 @@
from flask import Flask, render_template, request, redirect, url_for, session
from flask import Flask, render_template, request, redirect, url_for, session, make_response
import subprocess
import re
import os
@ -84,6 +84,9 @@ def create_email_account(username, password):
@app.route('/')
def index():
# Prevent caching and bypassing the CAPTCHA
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'
# Generate the CAPTCHA for the user
captcha_text = generate_captcha_text()
image = ImageCaptcha().generate(captcha_text)