Patch #32886

Rails 6: Use #media_type instead of #content_type to test the MIME type of a response

Added by Go MAEDA about 1 month ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Rails support
Target version:4.2.0

Description

Rails 6 displays deprecation warning if you use @response.content_type to check the MIME type of the response.

DEPRECATION WARNING: Rails 6.1 will return Content-Type header without modification. If you want just the MIME type, please use `#media_type` instead.

The attached patch replaces #content_type with #media_type to surpress the warning.

0001-Replace-content_type-with-media_type.patch Magnifier (95 KB) Go MAEDA, 2020-01-26 15:40


Related issues

Related to Redmine - Feature #29914: Migrate to Rails 6 New

Associated revisions

Revision 19467
Added by Go MAEDA about 1 month ago

Use #media_type instead of #content_type to test the MIME type of a response (#32886).

Patch by Go MAEDA.

History

#1 Updated by Go MAEDA about 1 month ago

#2 Updated by Go MAEDA about 1 month ago

  • Target version set to 4.2.0

#3 Updated by Go MAEDA about 1 month ago

  • Subject changed from Rails 6: Use #media_type instead of #content_type to test the MIME type of the response to Rails 6: Use #media_type instead of #content_type to test the MIME type of a response
  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch.

Also available in: Atom PDF