From 0fea7793b22efd2596983283947ee43687e0cfac Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 17 Aug 2015 07:46:54 +0000 Subject: mid: compress Message-IDs with '%' in them Some HTTP servers (apache2 2.2.22-13+deb7u5) on my system apparently do not handle "%25" correctly. I'm not yet sure if it's something weird with my rewrite rules or what.... --- lib/PublicInbox/MID.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm index d097011b..c75aa0e1 100644 --- a/lib/PublicInbox/MID.pm +++ b/lib/PublicInbox/MID.pm @@ -20,6 +20,14 @@ sub mid_clean { # this is idempotent sub mid_compressed { my ($mid) = @_; + + # XXX dirty hack! FIXME! + # Some HTTP servers (apache2 2.2.22-13+deb7u5 on my system) + # apparently do not handle "%25" in the URL path component correctly. + # I'm not yet sure if it's something weird with my rewrite rules + # or what; will need to debug... + return sha1_hex($mid) if (index($mid, '%') >= 0); + return $mid if (length($mid) <= MID_MAX); sha1_hex($mid); } -- cgit v1.2.3-24-ge0c7