Merge branch 'simple-login:master' into master

This commit is contained in:
Raymond Nook 2021-06-17 20:19:01 -07:00 committed by GitHub
commit 101c6c85ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -1202,7 +1202,7 @@ def sl_sendmail(
def get_queue_id(msg: Message) -> Optional[str]:
"""Get the Postfix queue-id from a message"""
received_header = msg["Received"]
received_header = str(msg["Received"])
if not received_header:
return

View File

@ -801,6 +801,9 @@ async def _hibp_check(api_key, queue):
elif r.status_code == 404:
# No breaches found
alias.hibp_breaches = []
elif r.status_code > 500:
LOG.w("HIBP server 5** error %s", r.status_code)
return
else:
LOG.error(
"An error occured while checking alias %s: %s - %s",

View File

@ -29,7 +29,7 @@ def test_different_scenarios_v4(flask_client):
# <<< with hostname >>>
r = flask_client.get(
url_for("api.options_v3", hostname="www.test.com"),
url_for("api.options_v4", hostname="www.test.com"),
headers={"Authentication": api_key.code},
)
@ -44,14 +44,14 @@ def test_different_scenarios_v4(flask_client):
db.session.commit()
r = flask_client.get(
url_for("api.options_v3", hostname="www.test.com"),
url_for("api.options_v4", hostname="www.test.com"),
headers={"Authentication": api_key.code},
)
assert r.json["recommendation"]["alias"] == alias.email
assert r.json["recommendation"]["hostname"] == "www.test.com"
def test_different_scenarios_v4(flask_client):
def test_different_scenarios_v4_2(flask_client):
user = User.create(
email="a@b.c", password="password", name="Test User", activated=True
)