Skip to content

Commit d09a39b

Browse files
committed
rm: Remove custom headers to use pre-defined one from core
1 parent e455f86 commit d09a39b

File tree

1 file changed

+2
-10
lines changed
  • user_scanner/user_scan/community

1 file changed

+2
-10
lines changed

user_scanner/user_scan/community/lemmy.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55

66
def validate_lemmy(user: str) -> Result:
7-
"""
8-
Check username availability on Lemmy (lemmy.world instance).
7+
""" Check username availability on Lemmy (lemmy.world instance)"""
98

10-
"""
119
# Lemmy username rules: 3-20 chars, alphanumeric and underscores only
1210
if not (3 <= len(user) <= 20):
1311
return Result.error("Length must be 3-20 characters")
@@ -17,13 +15,7 @@ def validate_lemmy(user: str) -> Result:
1715

1816
url = f"https://lemmy.world/api/v3/user?username={user}"
1917

20-
headers = {
21-
"User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36",
22-
"Accept": "application/json",
23-
"Accept-Encoding": "gzip, deflate, br, zstd",
24-
}
25-
26-
return status_validate(url, [400, 404], 200, headers=headers, timeout=5.0)
18+
return status_validate(url, [400, 404], 200, timeout=5.0)
2719

2820

2921
if __name__ == "__main__":

0 commit comments

Comments
 (0)