Prevent PUT requests to list resources.
Review Request #13284 — Created Sept. 22, 2023 and submitted
We've had a long-standing bug in the API where making a PUT request to a
list resource would generally cause a crash (depending on the particular
implementation of the resource'supdate
method, most of which end up
trying to callget_object
without the necessary object key in the
kwargs).This change makes it so that attempting to PUT to a list resource will
fail with an HTTP 405. We had a similar implementation for POST to item
resources, so this implementation is based on that.
- Did a PUT to a list resource and saw that I got back an HTTP 405
(method not allowed) instead of a 500 and HTML error content. - Ran unit tests.
- Updated Review Board unit tests to test this functionality for all
list resources.
Summary | ID |
---|---|
763b2063e8b6a7754e0f5ada1f8841e4ff5d7b70 |
Description | From | Last Updated |
---|---|---|
Can you update Djblets unit tests for these conditions? |
chipx86 | |
local variable 'response' is assigned to but never used Column: 9 Error code: F841 |
reviewbot | |
statement ends with a semicolon Column: 51 Error code: E703 |
reviewbot | |
local variable 'response' is assigned to but never used Column: 9 Error code: F841 |
reviewbot | |
local variable 'response' is assigned to but never used Column: 9 Error code: F841 |
reviewbot |
- Commits:
-
Summary ID 939063d8310394f5643cb1eb51bb12c47d8dbccb 09a5ffa13718d882590a2a5d49134cb90fb06b1e
Checks run (2 succeeded)
- Change Summary:
-
Add more tests.
- Commits:
-
Summary ID 09a5ffa13718d882590a2a5d49134cb90fb06b1e a8dfc1014521f4f578057a146bf8de70326cdd82