$extra not available for this
-public-inbox$extra is not available for this public-inbox
-Return to index
+ require PublicInbox::WwwStream;
+ PublicInbox::WwwStream::html_oneshot($ctx, 501, \<$extra is not available for this public-inbox
+Return to index
EOF
- [ 501, [ 'Content-Type' => 'text/html; charset=UTF-8' ], [ $msg ] ];
}
# /$INBOX/$MESSAGE_ID/t.mbox -> thread as mbox
@@ -433,17 +452,17 @@ sub msg_page {
}
sub serve_git {
- my ($ctx, $part, $path) = @_;
+ my ($ctx, $epoch, $path) = @_;
my $env = $ctx->{env};
my $ibx = $ctx->{-inbox};
- my $git = defined $part ? $ibx->git_part($part) : $ibx->git;
+ my $git = defined $epoch ? $ibx->git_epoch($epoch) : $ibx->git;
$git ? PublicInbox::GitHTTPBackend::serve($env, $git, $path) : r404();
}
sub mbox_results {
my ($ctx) = @_;
if ($ctx->{env}->{QUERY_STRING} =~ /(?:\A|[&;])q=/) {
- $ctx->{-inbox}->search or return need($ctx, 'search');
+ $ctx->{-inbox}->isrch or return need($ctx, 'search');
require PublicInbox::SearchView;
return PublicInbox::SearchView::mbox_results($ctx);
}
@@ -475,17 +494,19 @@ sub cgit {
require PublicInbox::Cgit;
PublicInbox::Cgit->new($pi_config);
} else {
+ require Plack::Util;
Plack::Util::inline_object(call => sub { r404() });
}
}
}
-sub www_listing {
- my ($self) = @_;
- $self->{www_listing} ||= do {
- require PublicInbox::WwwListing;
- PublicInbox::WwwListing->new($self);
- }
+# GET $INBOX/manifest.js.gz
+sub get_inbox_manifest ($$$) {
+ my ($ctx, $inbox, $key) = @_;
+ my $r404 = invalid_inbox($ctx, $inbox);
+ return $r404 if $r404;
+ require PublicInbox::ManifestJsGz;
+ PublicInbox::ManifestJsGz->response($ctx);
}
sub get_attach {
@@ -534,11 +555,15 @@ sub stylesheets_prepare ($$) {
$inline_ok = 0;
} else {
my $fn = $_;
+ my ($key) = (m!([^/]+?)(?:\.css)?\z!i);
+ if ($key !~ /\A[a-zA-Z0-9_\-\.]+\z/) {
+ warn "ignoring $fn, non-ASCII word character\n";
+ next;
+ }
open(my $fh, '<', $fn) or do {
warn "failed to open $fn: $!\n";
next;
};
- my ($key) = (m!([^/]+?)(?:\.css)?\z!i);
my $ctime = 0;
my $local = do { local $/; <$fh> };
if ($local =~ /\S/) {
@@ -626,4 +651,13 @@ sub get_css ($$$) {
[ 200, $h, [ $css ] ];
}
+sub get_description {
+ my ($ctx, $inbox) = @_;
+ invalid_inbox($ctx, $inbox) || do {
+ my $d = $ctx->{-inbox}->description . "\n";
+ [ 200, [ 'Content-Length', bytes::length($d),
+ 'Content-Type', 'text/plain' ], [ $d ] ];
+ };
+}
+
1;