t/check-www-inbox.perl | 22 ++++++++++++++++++++--
diff --git a/t/check-www-inbox.perl b/t/check-www-inbox.perl
index 08e62471fedbda310b953b980ad2fee1817588d1..7dd1eebeb00a268d7e141e136566db97b1151942 100644
--- a/t/check-www-inbox.perl
+++ b/t/check-www-inbox.perl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# Copyright (C) 2016-2018 all contributors
+# Copyright (C) 2016-2019 all contributors
# License: AGPL-3.0+
# Parallel WWW checker
my $usage = "$0 [-j JOBS] [-s SLOW_THRESHOLD] URL_OF_INBOX\n";
@@ -22,6 +22,16 @@ '-s|slow-threshold=f' => \$slow,
);
GetOptions(%opts) or die "bad command-line args\n$usage";
my $root_url = shift or die $usage;
+
+chomp(my $xmlstarlet = `which xmlstarlet 2>/dev/null`);
+my $atom_check = eval {
+ require IPC::Run;
+ my $cmd = [ qw(xmlstarlet val -e -) ];
+ sub {
+ my ($in, $out, $err) = @_;
+ IPC::Run::run($cmd, $in, $out, $err);
+ }
+} if $xmlstarlet;
my %workers;
$SIG{TERM} = sub { exit 0 };
@@ -146,7 +156,15 @@
# make sure the HTML source doesn't screw up terminals
# when people curl the source (not remotely an expert
# on languages or encodings, here).
- next if $r->header('Content-Type') !~ m!\btext/html\b!;
+ my $ct = $r->header('Content-Type');
+ if ($atom_check && $ct =~ m!\bapplication/atom\+xml\b!) {
+ my $raw = $r->decoded_content;
+ my ($out, $err) = ('', '');
+ $atom_check->(\$raw, \$out, \$err) and
+ warn "Atom ($?) - $u - <1:$out> <2:$err>\n";
+ }
+
+ next if $ct !~ m!\btext/html\b!;
my $dc = $r->decoded_content;
if ($dc =~ /([\x00-\x08\x0d-\x1f\x7f-\x{99999999}]+)/s) {
my $o = $1;