[ruby-list:41798] expires header の指定

From: Takayuki Suzuki <h-taka@...>
Date: 2006-01-26 02:38:59 UTC
List: ruby-list #41798
鈴木と申します。

CGIクラスのheaderメソッドで
Expires: 0
というHTTPヘッダを生成したいのですが、
可能なのでしょうか?

% ruby --version
ruby 1.8.3 (2005-09-21) [i386-freebsd4.7]

で以下のように試してみましたがだめでした。

irb(main):021:0> cgi.header({'expires'=>nil})
TypeError: can't clone NilClass
        from /usr/local/lib/ruby/1.8/cgi.rb:455:in `clone'
        from /usr/local/lib/ruby/1.8/cgi.rb:455:in `rfc1123_date'
        from /usr/local/lib/ruby/1.8/cgi.rb:601:in `header'
        from (irb):21
        from :0
irb(main):022:0> cgi.header({'expires'=>0})
TypeError: can't clone Fixnum
        from /usr/local/lib/ruby/1.8/cgi.rb:455:in `clone'
        from /usr/local/lib/ruby/1.8/cgi.rb:455:in `rfc1123_date'
        from /usr/local/lib/ruby/1.8/cgi.rb:601:in `header'
        from (irb):22
        from :0
irb(main):023:0> cgi.header({'expires'=>"0"})
NoMethodError: undefined method `gmtime' for "0":String
        from /usr/local/lib/ruby/1.8/cgi.rb:455:in `rfc1123_date'
        from /usr/local/lib/ruby/1.8/cgi.rb:601:in `header'
        from (irb):23
        from :0

--
鈴木

In This Thread

Prev Next