Sha256: 6e8092ba937abb3bbff6ba55c2fdf048b62eb4ab9a5d7fc8dd37431909d2e11f

Contents?: true

Size: 760 Bytes

Versions: 5

Compression:

Stored size: 760 Bytes

Contents

# XXX THIS IS A HACK MFERS
require 'rack/handler'
require 'rack/handler/fastcgi'

module ForgetPasswords
  # XXX this unfortunate chunk of code exists because of
  # https://bz.apache.org/bugzilla/show_bug.cgi?id=65984
  class FastCGI < Rack::Handler::FastCGI

    def self.send_headers(out, status, headers)
      out.print "Status: #{status}\r\n"
      headers.each do |k, vs|
        vs.split("\n").each { |v|  out.print "#{k}: #{v}\r\n" }
      end
      out.print "\r\n"
      # we remove out.flush from the headers
      # out.flush
    end

    def self.send_body(out, body)
      body.each { |part| out.print part }
      # this one we keep and put it outside the loop
      out.flush
    end
  end

  Rack::Handler.register 'hacked-fcgi', FastCGI
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
forget-passwords-0.3.1 lib/forget-passwords/fastcgi.rb
forget-passwords-0.3.0 lib/forget-passwords/fastcgi.rb
forget-passwords-0.2.13 lib/forget-passwords/fastcgi.rb
forget-passwords-0.2.12 lib/forget-passwords/fastcgi.rb
forget-passwords-0.2.9 lib/forget-passwords/fastcgi.rb