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 subprocess
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
|
@ -84,6 +84,9 @@ def create_email_account(username, password):
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
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
|
# Generate the CAPTCHA for the user
|
||||||
captcha_text = generate_captcha_text()
|
captcha_text = generate_captcha_text()
|
||||||
image = ImageCaptcha().generate(captcha_text)
|
image = ImageCaptcha().generate(captcha_text)
|
||||||
|
|
Loading…
Reference in New Issue