summaryrefslogtreecommitdiff
path: root/src/mailman/rest/members.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rest/members.py')
-rw-r--r--src/mailman/rest/members.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mailman/rest/members.py b/src/mailman/rest/members.py
index 8c0593457..d9fd50e24 100644
--- a/src/mailman/rest/members.py
+++ b/src/mailman/rest/members.py
@@ -27,6 +27,7 @@ __all__ = [
from restish import http, resource
+from urllib import quote
from zope.component import getUtility
from mailman.app.membership import delete_member
@@ -115,9 +116,12 @@ class AllMembers(_MemberBase):
return http.bad_request([], b'Invalid email address')
except ValueError as error:
return http.bad_request([], str(error))
- # wsgiref wants headers to be bytes, not unicodes.
+ # wsgiref wants headers to be bytes, not unicodes. Also, we have to
+ # quote any unsafe characters in the address. Specifically, we need
+ # to quote forward slashes, but not @-signs.
+ quoted_address = quote(member.address.address, safe=b'@')
location = path_to('lists/{0}/member/{1}'.format(
- member.mailing_list, member.address.address))
+ member.mailing_list, quoted_address))
# Include no extra headers or body.
return http.created(location, [], None)