return if index($str, '//') >= 0;
my $first = '';
+ utf8::encode($str); # to octets
if ($str =~ s/\A([^A-Ya-z])//ms) { # start with a letter
$first = sprintf('Z%02x', ord($1));
}
$str =~ s/([^A-Za-z0-9_\.\-])/$ESCAPES{$1}/egms;
+ utf8::decode($str); # allow wide chars
$first . $str;
}
}
$str =~ s!::([a-f0-9]{2})!chr(hex($1))!egms;
$str =~ tr!:!/!;
+ utf8::decode($str);
$first . $str;
}
Subject: [PATCH] TODO: take expert web design advice
Date: Mon, 1 Apr 2019 08:15:20 +0000
Message-Id: <20190401081523.16213-1-BOFH@YHBT.net>
+Content-Type: text/plain; charset=utf-8
---
TODO | 2 ++
+ Ω | 5 --
1 file changed, 2 insertions(+)
diff --git a/TODO b/TODO
my $non_existent = 'ee5e32211bf62ab6531bdf39b84b6920d0b6775a';
my $client = sub {
my ($cb) = @_;
- my $res = $cb->(GET("/$name/3435775/s/"));
+ my $mid = '20190401081523.16213-1-BOFH@YHBT.net';
+ my @warn;
+ my $res = do {
+ local $SIG{__WARN__} = sub { push @warn, @_ };
+ $cb->(GET("/$name/$mid/"));
+ };
+ is_deeply(\@warn, [], 'no warnings from rendering diff');
+ like($res->content, qr!>Ω</a>!, 'omega escaped');
+
+ $res = $cb->(GET("/$name/3435775/s/"));
is($res->code, 200, 'success with existing blob');
$res = $cb->(GET("/$name/".('0'x40).'/s/'));