An attempt to prevent caching and bypassing CAPTCHA
This commit is contained in:
parent
f44cdfa456
commit
8ba3a8fcea
5
app.py
5
app.py
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue