From: MoonWolf Date: 2003-03-19T12:16:45+09:00 Subject: Re: OT: Getting at client headers from CGIs > Folks: > > is there any way to get to the client request headers in a Ruby CGI > script. In particular I'm looking for the If-Modified-Since header, > which I was expecting (under Apache) to turn up in > ENV['HTTP_IF_MODIFIED_SINCE']. However, apparently this isn't the case > (at least in my configuration). Is there something I can do to get at > this header? use NPH(non-parsed-header) CGI. rename 'your-script.cgi' => 'nph-your-script.cgi' and CGI#out({'nph'=>true}) nph-sample.cgi: #!/usr/local/bin/ruby require "cgi" cgi = CGI.new cgi.out( 'nph'=>true, 'type'=>'text/plain', 'Last-Modified' => Time.now ) { ENV.sort.collect {|k,v| "#{k}:#{v}\n" }.join } -- MoonWolf