diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-22 08:14:19 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-22 08:14:19 +0000 |
commit | 641d171a6bcb1f4ebb87b317f8eaca825da501c1 (patch) | |
tree | 350d0de7980b345f639b94913edc5d21f5f7c92e /lib/PublicInbox/Import.pm | |
parent | 4c5fa84eec85cf406cbcd900f92dc478ed14ea30 (diff) | |
download | public-inbox-641d171a6bcb1f4ebb87b317f8eaca825da501c1.tar.gz |
We want to make it clear to the code and DEBUG_DIFF users that we do not introduce messages with unsuitable headers into public archives.
Diffstat (limited to 'lib/PublicInbox/Import.pm')
-rw-r--r-- | lib/PublicInbox/Import.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index d69934b0..5d116a1c 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -288,6 +288,14 @@ sub extract_author_info ($) { ($name, $email); } +# kill potentially confusing/misleading headers +sub drop_unwanted_headers ($) { + my ($mime) = @_; + + $mime->header_set($_) for qw(bytes lines content-length status); + $mime->header_set($_) for @PublicInbox::MDA::BAD_HEADERS; +} + # returns undef on duplicate # returns the :MARK of the most recent commit sub add { @@ -321,9 +329,7 @@ sub add { _check_path($r, $w, $tip, $path) and return; } - # kill potentially confusing/misleading headers - $mime->header_set($_) for qw(bytes lines content-length status); - $mime->header_set($_) for @PublicInbox::MDA::BAD_HEADERS; + drop_unwanted_headers($mime); # spam check: if ($check_cb) { |