Skip to content

Conversation

@eugeneius
Copy link
Contributor

Fixes #312.

Rails 6.0.0.rc2 changed the behaviour of the content_type method to include the charset media type parameter. This broke our content type check, which assumed no parameters would be present. A new media_type method was also added that returns the media type without parameters.

We can fix the content type check on Rails 6.0 while staying compatible with older Rails versions by using the media_type method if it exists, and falling back to the content_type method otherwise.

Rails 6.0.0.rc2 changed the behaviour of the `content_type` method to
include the `charset` media type parameter. This broke our content type
check, which assumed no parameters would be present. A new `media_type`
method was also added that returns the media type without parameters.

We can fix the content type check on Rails 6.0 while staying compatible
with older Rails versions by using the `media_type` method if it exists,
and falling back to the `content_type` method otherwise.
@eugeneius eugeneius merged commit bbcb58b into master Aug 6, 2019
@jonnyom jonnyom deleted the elk/media_type branch August 6, 2019 15:30
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

Successfully merging this pull request may close these issues.

Messenger is not visible in Rails 6.0rc2

3 participants