mirror of
https://github.com/simple-login/app.git
synced 2024-09-29 21:21:29 +02:00
make sure reply_email only contain lowercase
This commit is contained in:
parent
d108d7b8b7
commit
c25a5b50f6
@ -742,8 +742,7 @@ def generate_reply_email(contact_email: str) -> str:
|
|||||||
|
|
||||||
# make sure contact_email can be ascii-encoded
|
# make sure contact_email can be ascii-encoded
|
||||||
contact_email = convert_to_id(contact_email)
|
contact_email = convert_to_id(contact_email)
|
||||||
# remove potential space
|
contact_email = contact_email.lower().strip().replace(" ", "")
|
||||||
contact_email = contact_email.replace(" ", "")
|
|
||||||
contact_email = contact_email[:45]
|
contact_email = contact_email[:45]
|
||||||
contact_email = contact_email.replace("@", ".at.")
|
contact_email = contact_email.replace("@", ".at.")
|
||||||
|
|
||||||
|
@ -404,7 +404,11 @@ def test_generate_reply_email(flask_client):
|
|||||||
assert reply_email.endswith(EMAIL_DOMAIN)
|
assert reply_email.endswith(EMAIL_DOMAIN)
|
||||||
|
|
||||||
reply_email = generate_reply_email("👌汉字@example.org")
|
reply_email = generate_reply_email("👌汉字@example.org")
|
||||||
assert reply_email.startswith("ra+YiZi.at.example.org+")
|
assert reply_email.startswith("ra+yizi.at.example.org+")
|
||||||
|
|
||||||
|
# make sure reply_email only contain lowercase
|
||||||
|
reply_email = generate_reply_email("TEST@example.org")
|
||||||
|
assert reply_email.startswith("ra+test.at.example.org")
|
||||||
|
|
||||||
|
|
||||||
def test_get_addrs_from_header():
|
def test_get_addrs_from_header():
|
||||||
|
Loading…
Reference in New Issue
Block a user