2007-01-12 19:00:05

LWP::UserAgent::WithCache

[Perl]

http://search.cpan.org/~sekimura/LWP-UserAgent-WithCache-0.03/
レスポンス304時の、本来Cacheが返ってきて欲しいところで、contentが空で返ってくる。
ハマった。

http://rt.cpan.org/Public/Bug/Display.html?id=16377
にある以下のパッチを適用。
--- WithCache.pm (revision 9476)
+++ WithCache.pm (working copy)
@@ -36,7 +36,7 @@
if ( defined $obj ) {

# XXX: return cached response before "Expires"
- if (defined $obj->{expires} and $obj->{expires} > time()) {
+ unless (defined $obj->{expires} and $obj->{expires} <= time()) {
return HTTP::Response->parse($obj->{as_string});
}

解決。