Sha256: de23cc307a2fbeae5914f9fc43b03ef5b77c07cade430d8acbcd1d3acfd52a4f

Contents?: true

Size: 1.27 KB

Versions: 4

Compression:

Stored size: 1.27 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/>.

require 'rubygems'
require 'rack'

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

4 entries across 4 versions & 1 rubygems

Version Path
webroar-0.4.0 src/ruby_lib/ruby_interface/deflater.rb
webroar-0.3.1 src/ruby_lib/ruby_interface/deflater.rb
webroar-0.3.0 src/ruby_lib/ruby_interface/deflater.rb
webroar-0.2.6 src/ruby_lib/ruby_interface/deflater.rb