Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies = [
"pyyaml",
"nostr @ git+https://github.com/earonesty/python-nostr.git@snostr-compat",
"requests",
"security==1.3.1",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Python API calls.

License: MITOpen SourceMore facts

]
license = {file = "LICENSE"}
classifiers=[
Expand Down
3 changes: 2 additions & 1 deletion snostr/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException
import secrets
from security import safe_requests

if TYPE_CHECKING:
from snostr.config import Config
Expand Down Expand Up @@ -346,7 +347,7 @@ def scrape_nip5(maybe):
return None
log.debug("try nip5 for %s", maybe)
try:
res = requests.get(f"https://{base}/.well-known/nostr.json?name={name}", timeout=2)
res = safe_requests.get(f"https://{base}/.well-known/nostr.json?name={name}", timeout=2)
except requests.RequestException:
return None
if res.status_code != 200:
Expand Down