You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Daniel Quinlan <qu...@pathname.com> on 2005/10/21 08:14:03 UTC

Node::header()

Hmmm... why do we strip whitespace from the keys?

This routine is so frequently called, extra work is bad.

Daniel

# Store or retrieve headers from a given MIME object
#
sub header {
  my $self   = shift;
  my $rawkey = shift;

  return unless ( defined $rawkey );

  # we're going to do things case insensitively
  my $key    = lc($rawkey);

  # Trim whitespace off of the header keys
  $key       =~ s/^\s+//;
  $key       =~ s/\s+$//;

-- 
Daniel Quinlan
http://www.pathname.com/~quinlan/