about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwText.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-12 11:47:05 +0000
committerEric Wong <e@80x24.org>2021-10-12 21:46:38 +0000
commit97510d7a92b4e44318d1917a54c70d536bbf46f2 (patch)
tree5e04f732927b920221822a9afca55c3e99a090d7 /lib/PublicInbox/WwwText.pm
parent9f02576da775abf208f5a03c03b6f7abd72596d0 (diff)
downloadpublic-inbox-97510d7a92b4e44318d1917a54c70d536bbf46f2.tar.gz
www: _/text/config/raw Last-Modified: is mm->created_at
This allows IMAP mirrors to keep UIDVALIDITY synchronized (and
"LIST ACTIVE.TIMES" in NNTP).  "lei add-external --mirror" will
automatically set it, as will the combination of
public-inbox-clone + public-inbox-index.

This avoids the need for extra endpoints or config entries,
at least...
Diffstat (limited to 'lib/PublicInbox/WwwText.pm')
-rw-r--r--lib/PublicInbox/WwwText.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/WwwText.pm b/lib/PublicInbox/WwwText.pm
index bb9a0a0f..8b929f74 100644
--- a/lib/PublicInbox/WwwText.pm
+++ b/lib/PublicInbox/WwwText.pm
@@ -8,6 +8,7 @@ use v5.10.1;
 use PublicInbox::Linkify;
 use PublicInbox::WwwStream;
 use PublicInbox::Hval qw(ascii_html prurl);
+use HTTP::Date qw(time2str);
 use URI::Escape qw(uri_escape_utf8);
 use PublicInbox::GzipFilter qw(gzf_maybe);
 our $QP_URL = 'https://xapian.org/docs/queryparser.html';
@@ -171,6 +172,8 @@ sub inbox_config ($$$) {
         my ($ctx, $hdr, $txt) = @_;
         my $ibx = $ctx->{ibx};
         push @$hdr, 'Content-Disposition', 'inline; filename=inbox.config';
+        my $t = eval { $ibx->mm->created_at };
+        push(@$hdr, 'Last-Modified', time2str($t)) if $t;
         my $name = dq_escape($ibx->{name});
         my $inboxdir = '/path/to/top-level-inbox';
         my $base_url = $ibx->base_url($ctx->{env});