Prevent PUT requests to list resources.

Review Request #13284 — Created Sept. 22, 2023 and submitted — Latest diff uploaded

Information

Djblets
release-4.x

Reviewers

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's update method, most of which end up
trying to call get_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.

Commits

Files

    Loading...