instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.43k stars 2.43k forks source link

Set and update Late policy adds 200 points to the request cost #2160

Open meeple142 opened 1 year ago

meeple142 commented 1 year ago

Summary:

When posting or patching a late policy the X-Request-Cost get bumped by 200 points, where most calls are less than 0.5 points.

Steps to reproduce:

  1. call POST /api/v1/courses/:id/late_policy or PATCH /api/v1/courses/:id/late_policy
  2. look at X-Request-Cost header

Expected behavior:

X-Request-Cost is less than 1

Actual behavior:

X-Request-Cost is greater than 200

Additional notes:

here is the code that is causing the 200 points to be added https://github.com/instructure/canvas-lms/blob/fe7a1fa8587811ba2cbc1006a0ad1bd2cbed18a2/app/controllers/late_policy_controller.rb#L156 https://github.com/instructure/canvas-lms/blob/fe7a1fa8587811ba2cbc1006a0ad1bd2cbed18a2/app/controllers/late_policy_controller.rb#L195