Sha256: e250974a3540317b621ed8e567483a4133c3274909d12d9978079f6df19b782c

Contents?: true

Size: 579 Bytes

Versions: 8

Compression:

Stored size: 579 Bytes

Contents

# Takes care of ensuring the Content-Type is set to application/xhtml+xml
# for docomo devices as is required to use xhtml instead of text/html.  If
# text/html is used, the content is rendered as the vastly inferior i-mode
# html (aka CHTML).
class Galakei::Filter::ContentType < Galakei::Filter::Base
  # :stopdoc:
  def condition?
    request.docomo? && html_content_type?
  end

  def filter
    Rails.logger.debug("[galakei] DoCoMo browser 1.0 and HTML detected, changing content type to application/xhtml+xml")
    response.content_type = 'application/xhtml+xml'
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
galakei-0.15.2 lib/galakei/filter/content_type.rb
galakei-0.15.1 lib/galakei/filter/content_type.rb
galakei-0.15.0 lib/galakei/filter/content_type.rb
galakei-0.14.4 lib/galakei/filter/content_type.rb
galakei-0.14.3 lib/galakei/filter/content_type.rb
galakei-0.14.2 lib/galakei/filter/content_type.rb
galakei-0.14.1 lib/galakei/filter/content_type.rb
galakei-0.14.0 lib/galakei/filter/content_type.rb