Skip to content

Commit 7e32f50

Browse files
committed
test: add tests for rfc5322 helpers
1 parent 70fd1ba commit 7e32f50

File tree

2 files changed

+752
-5
lines changed

2 files changed

+752
-5
lines changed

src/soar_sdk/extras/email/rfc5322.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ def _extract_urls_from_content(content: str, urls: set[str], is_html: bool) -> N
154154
content = unescape(content)
155155
uri_matches = re.findall(URI_REGEX, content)
156156
for uri in uri_matches:
157-
cleaned = clean_url(uri)
158-
if cleaned.startswith("http"):
159-
urls.add(cleaned)
157+
urls.add(clean_url(uri))
160158

161159

162160
def extract_email_headers(mail: Message, email_id: str | None = None) -> EmailHeaders:
@@ -222,8 +220,6 @@ def extract_email_body(mail: Message) -> EmailBody:
222220

223221
if content_type == "text/plain" and not body.plain_text:
224222
body.plain_text = decoded
225-
if not body.charset:
226-
body.charset = part_charset
227223
elif content_type == "text/html" and not body.html:
228224
body.html = decoded
229225

0 commit comments

Comments
 (0)