mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Properly encode path components used to construct API URLs
Resolves #144 and similar potential issues
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from six.moves.urllib.parse import quote
|
||||
|
||||
from ..exceptions import AnymailRequestsAPIError
|
||||
from ..message import AnymailRecipientStatus, ANYMAIL_STATUSES
|
||||
from ..utils import get_anymail_setting, EmailAddress, parse_address_list
|
||||
@@ -131,7 +133,7 @@ class MailjetPayload(RequestsPayload):
|
||||
template_id = self.data.get("Mj-TemplateID")
|
||||
if template_id and not self.data.get("FromEmail"):
|
||||
response = self.backend.session.get(
|
||||
"%sREST/template/%s/detailcontent" % (self.backend.api_url, template_id),
|
||||
"%sREST/template/%s/detailcontent" % (self.backend.api_url, quote(str(template_id), safe='')),
|
||||
auth=self.auth, timeout=self.backend.timeout
|
||||
)
|
||||
self.backend.raise_for_status(response, None, self.message)
|
||||
|
||||
Reference in New Issue
Block a user