Skip to content

Commit

Permalink
urlparse instead of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKalopsia committed Nov 14, 2024
1 parent 21e66a8 commit 2c94109
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import os
import re
from urllib.parse import urlparse
import requests
import webfinger

Expand Down Expand Up @@ -69,8 +69,8 @@ def login():
),
None,
)
match = re.search(r"https://([^/]+)/", profile_url)
instance = match.group(1)
parsed_url = urlparse(profile_url)
instance = parsed_url.hostname

metadata = None

Expand Down

0 comments on commit 2c94109

Please sign in to comment.