instructure / canvas-lms

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

Handle Rails 7.1 Content Type deprecation in Grade Passback #2377

Closed RyanJWolfe closed 4 days ago

RyanJWolfe commented 4 days ago

Rails 7.1 deprecates using #content_type for checking media types. https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#actiondispatch-request-content-type-now-returns-content-type-header-as-it-is

Because Canvas currently has an exact check against content type, many clients are failing with 415 errors because they POST with a content type header of application/xml; charset=utf-8.

Changing to #media_type fixes this.

Test plan:

CLAassistant commented 4 days ago

CLA assistant check
All committers have signed the CLA.

ccutrer commented 4 days ago

I'm running this through our full test suite, and will merge (and deploy) this soon. Thank you for the concise PR with a spec.

ccutrer commented 4 days ago

Merged in 80f4bf9f4e238b60d52ebe7d3eea4dd25445d99d

markng commented 4 days ago

Merged in 80f4bf9

Thanks for merging and deploying this for us quickly @ccutrer !