def CGI::header(*options)
if defined?(MOD_RUBY)
options.each{|option|
option.sub(/(.*?): (.*)/){
Apache::request.headers_out[$1] = $2
}
}
Apache::request.send_http_header
''
else
if options.delete("nph") or (ENV['SERVER_SOFTWARE'] =~ /IIS/)
[(ENV['SERVER_PROTOCOL'] or "HTTP/1.0") + " 200 OK",
"Date: " + rfc1123_date(Time.now),
"Server: " + (ENV['SERVER_SOFTWARE'] or ""),
"Connection: close"] +
(options.empty? ? ["Content-Type: text/html"] : options)
else
options.empty? ? ["Content-Type: text/html"] : options
end.join(EOL) + EOL + EOL
end
end