Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of deprecation warning to change content_type to media_type in Rails 6 #142

Open
siruguri opened this issue Aug 13, 2019 · 5 comments

Comments

@siruguri
Copy link

I am seeing this error in my app while I test upgrading to Rails 6.0.0.rc2

DEPRECATION WARNING: Rails 6.1 will return Content-Type header without modification. If you want just the MIME type, please use `#media_type` instead. (called from append_info_to_payload at /Users/sameer/.rvm/gems/ruby-2.6.3/gems/skylight-core-4.1.2/lib/skylight/core/probes/action_controller.rb:15)

The relevant line does this:

type_str = content_type.to_s.split(';').first

@zvkemp
Copy link
Contributor

zvkemp commented Aug 13, 2019

Thanks @siruguri. We have a branch in progress that will fix this issue, and will notify you here when it has been released.

@zvkemp
Copy link
Contributor

zvkemp commented Aug 14, 2019

@siruguri in the meantime you can silence the warnings and return to the previous behavior of content_type by setting config.action_dispatch.return_only_media_type_on_content_type = false

@olly
Copy link

olly commented Oct 14, 2019

@zvkemp I've just tried upgrading an application to Rails v6, and just a heads up, that setting doesn't seem to disable the deprecation warning. (Also removing the skylight gem, removed the deprecation warnings, so I'm pretty sure there wasn't some other culprit).

@zvkemp
Copy link
Contributor

zvkemp commented Oct 14, 2019

This is fixed as of Skylight 4.2.0-beta (current prerelease version is 4.2.0-beta3). @olly Could you let me know what version(s) of Skylight you tried, and could you confirm that you fully restarted your application after making that config change?

@olly
Copy link

olly commented Oct 14, 2019

@zvkemp you're right. I think I must have had some weird interaction with the spring preloader. That configuration setting does seem to fix it. Thanks. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants