Sha256: ae3857b86d5edf60a52f121bfc77aaa5ebd60fa75b6754062a2336760456e51d

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

# WebROaR - Ruby Application Server - http://webroar.in/
# Copyright (C) 2009  Goonj LLC
#
# This file is part of WebROaR.
#
# WebROaR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WebROaR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with WebROaR.  If not, see <http://www.gnu.org/licenses/>.

module Webroar  
  
  class Deflater < Rack::Deflater
  
    def initialize(app)
      @app = app
      super
    end
    
    def call(env)
      # Skip compressing entity body if user agent is IE6
      # refer http://schroepl.net/projekte/mod_gzip/browser.htm and 
      # http://support.microsoft.com/default.aspx?scid=kb;en-us;Q313712
      # for problem details
      # 
      if env['HTTP_USER_AGENT'] =~ /MSIE 6.0/
        @app.call(env)
      else       
        super        
      end  
    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webroar-0.7.0 src/ruby_lib/ruby_interface/deflater.rb
webroar-0.6.1 src/ruby_lib/ruby_interface/deflater.rb
webroar-0.5.0 src/ruby_lib/ruby_interface/deflater.rb