Attempting to PATCH an invalid attribute on a member object in REST API results in 500, instead of 400.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
Fix Released
|
Medium
|
Barry Warsaw |
Bug Description
If you send a PATCH request to a member with an invalid parameter (anything other than "address", at the moment) you get a 500 response, instead of a 400 Bad Request. Here is the unhandled exception generating the 500 error:
Traceback (most recent call last):
File "/usr/lib64/
self.result = application(
File "/home/
environ, start_response)
File "/home/
response = self.get_
File "/home/
resource_
File "/home/
return _dispatch(request, match, lambda r: callable(self, r))
File "/home/
response = func(request)
File "/home/
return _dispatch(request, match, lambda r: callable(self, r))
File "/home/
return self.func(resource, request)
File "/home/
values = Validator(
File "/home/
raise ValueError(
ValueError: Unexpected parameters: delivery_mode
Related branches
- Mailman Coders: Pending requested
-
Diff: 500 lines (+130/-11)3 files modifiedsrc/mailman/rest/docs/addresses.txt (+5/-0)
src/mailman/rest/docs/membership.rst (+104/-2)
src/mailman/rest/members.py (+21/-9)
Changed in mailman: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Barry Warsaw (barry) |
milestone: | none → 3.0.0a8 |
status: | Confirmed → Fix Committed |
Changed in mailman: | |
status: | Fix Committed → Fix Released |
Here's a simple fix.