diff --git a/lib/intercom-rails/auto_include_filter.rb b/lib/intercom-rails/auto_include_filter.rb index 29be93c..1f28360 100644 --- a/lib/intercom-rails/auto_include_filter.rb +++ b/lib/intercom-rails/auto_include_filter.rb @@ -55,7 +55,11 @@ def response end def html_content_type? - response.content_type == 'text/html' + if response.respond_to?(:media_type) + response.media_type == 'text/html' + else + response.content_type == 'text/html' + end end def response_has_closing_body_tag?