mirror of
https://codeberg.org/angestoepselt/homepage.git
synced 2025-05-24 14:46:16 +00:00
Fix hCaptcha falsely not included in final output
This commit is contained in:
parent
5e83e9e5c4
commit
d4f470ba71
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import collections
|
|||
from collections.abc import Mapping
|
||||
import hmac
|
||||
import mimetypes
|
||||
import re
|
||||
import os
|
||||
import secrets
|
||||
from typing import Any, Optional, overload
|
||||
|
|
@ -71,7 +72,7 @@ match os.environ.get("REQUEST_METHOD", "").upper():
|
|||
# place the token *inside* the form. It assumes that there is
|
||||
# a) only one form on the site and
|
||||
# b) the <form> tag doesn't end on the same line.
|
||||
if "<!-- FORM -->" in line.lower():
|
||||
if re.match(r"<!--\s*form\s*-->", line, re.IGNORECASE) is not None:
|
||||
print(f'<input type="hidden" name="csrftoken" value="{csrf_token}" />')
|
||||
|
||||
print(f'<label class="form-input">')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue