Skip to content

Commit

Permalink
Mailtrap backend: quote user-provided url parts
Browse files Browse the repository at this point in the history
  • Loading branch information
cahna committed Nov 24, 2024
1 parent d45afee commit 0e84927
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion anymail/backends/mailtrap.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import warnings
from urllib.parse import quote

if sys.version_info < (3, 11):
from typing_extensions import Any, Dict, List, Literal, NotRequired, TypedDict
Expand Down Expand Up @@ -68,7 +69,8 @@ def __init__(

def get_api_endpoint(self):
if self.backend.testing_enabled:
return f"send/{self.backend.test_inbox_id}"
test_inbox_id = quote(self.backend.test_inbox_id, safe="")
return f"send/{test_inbox_id}"
return "send"

def serialize_data(self):
Expand Down

0 comments on commit 0e84927

Please sign in to comment.