Sandbox URL Creation

This commit is contained in:
pixeebot[bot]
2025-07-07 03:10:56 +00:00
committed by GitHub
parent 77b9701b5e
commit 34e0f0c433
2 changed files with 3 additions and 3 deletions

View File

@@ -3,8 +3,6 @@ from datetime import datetime, timezone
from email.utils import unquote
from urllib.parse import quote, urljoin
import requests
from ..exceptions import AnymailConfigurationError
from ..inbound import AnymailInboundMessage
from ..signals import (
@@ -17,6 +15,7 @@ from ..signals import (
)
from ..utils import get_anymail_setting
from .base import AnymailBaseWebhookView
from security import safe_requests
class BrevoBaseWebhookView(AnymailBaseWebhookView):
@@ -216,7 +215,7 @@ class BrevoInboundWebhookView(BrevoBaseWebhookView):
# FUTURE: somehow defer download until attachment is accessed?
token = attachment["DownloadToken"]
url = urljoin(self.api_url, f"inbound/attachments/{quote(token, safe='')}")
response = requests.get(url, headers={"api-key": self.api_key})
response = safe_requests.get(url, headers={"api-key": self.api_key})
response.raise_for_status() # or maybe just log and continue?
content = response.content

View File

@@ -63,6 +63,7 @@ dependencies = [
"django>=4.0",
"requests>=2.4.3",
"urllib3>=1.25.0", # requests dependency: fixes RFC 7578 header encoding
"security==1.3.1",
]
[project.optional-dependencies]