diff options
author | Eric Wong <e@80x24.org> | 2015-08-17 07:46:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-08-17 07:51:53 +0000 |
commit | 0fea7793b22efd2596983283947ee43687e0cfac (patch) | |
tree | 50ec37c06e6834c500430652fb24c79f798d6980 /lib | |
parent | 5c3f7d5f9a03056da6740af523f22903880cc9ec (diff) | |
download | public-inbox-0fea7793b22efd2596983283947ee43687e0cfac.tar.gz |
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....
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/MID.pm | 8 |
1 files changed, 8 insertions, 0 deletions
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); } |