Open Bug 2072313 Opened 3 days ago Updated 1 day ago

Bugzilla::API::V1::Reminders ignores query-string parameters on POST

Categories

(bugzilla.mozilla.org :: API, defect)

Production
defect

Tracking

()

UNCONFIRMED

People

(Reporter: xavier.lhour, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

Bugzilla::API::V1::Reminders's add() only reads parameters from the JSON POST body, with no query-string merge.
Same gap as 2072305.

Fix using the same shared helper introduced in 2072305, rather than reimplementing the merge locally.

Depends on: 2072305

Fixed by reusing the merge_request_params helper introduced in 2072305 (also used by 2065171/2065173), instead of writing another copy of the same query-string/JSON-body merge logic.

No field whitelist was needed here, unlike Component (2072305) and Group (2065173): Reminders' add() only reads three named keys (bug_id, note, reminder_ts) out of the merged params, rather than passing the whole hash to a set_all()-style method, so there's no stray-key/unknown_method risk to guard against.

Side effect
This removes the try/catch block that bug 2072318 was filed against (the return inside catch that never actually aborted add() on malformed JSON). That code no longer exists after this change (merge_request_params silently ignores an invalid JSON body rather than raising rest_malformed_json, same as the other migrated resources), so 2072318 is resolved as a side effect rather than needing its own patch. Marking that bug as resolved by this one once this PR lands.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: