From: Rob Blackbourn Date: 2002-12-04T18:49:45+09:00 Subject: mod_ruby HEAD message Is it possible (and sensible) to change cgi.out to handle HEAD messages with the following; def out(options = "text/html") options = { "type" => options } if options.kind_of?(String) content = yield if options.has_key?("charset") require "nkf" case options["charset"] when /iso-2022-jp/ni content = NKF::nkf('-j', content) options["language"] = "ja" unless options.has_key?("language") when /euc-jp/ni content = NKF::nkf('-e', content) options["language"] = "ja" unless options.has_key?("language") when /shift_jis/ni content = NKF::nkf('-s', content) options["language"] = "ja" unless options.has_key?("language") end end options["length"] = content.length.to_s output = stdoutput output.binmode if defined? output.binmode output.print header(options) >> exit (Apache::OK) if defined?(MOD_RUBY) && Apache.request.headeronly? << output.print content unless "HEAD" == env_table['REQUEST_METHOD'] end Rob