Project

General

Profile

Actions

Patch #32886

closed

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

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

Added by Go MAEDA almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails support
Target version:

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.


Files


Related issues 1 (0 open — 1 closed)

Related to Redmine - Feature #29914: Migrate to Rails 6.1 with Zeitwerk autoloadingClosedGo MAEDAActions

Updated by Go MAEDA almost 7 years ago Actions #1

  • Related to Feature #29914: Migrate to Rails 6.1 with Zeitwerk autoloading added

Updated by Go MAEDA almost 7 years ago Actions #2

  • Target version set to 4.2.0

Updated by Go MAEDA almost 7 years ago Actions #3

  • 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.

Actions

Also available in: PDF Atom