Date: | Wed, 9 Apr 2003 22:26:58 +0100 |
From: | Richard Clamp <richardc [...] unixbeard.net> |
To: | bug-Email-Simple [...] rt.cpan.org |
Subject: | header_set and case sensitivity |
Found this one accidentally:
use Email::Simple;
my $m = Email::Simple->new("Foo-Bar: Baz\n\ntest\n");
$m->header_set("Foo-bar", "quux");
print $m->as_string;
Outputs
Foo-Bar: Baz
Foo-bar: quux
test
This is a fix:
--- Email-Simple/Simple.pm 2003-04-07 17:31:54.000000000 +0100
+++ Email-Simple_richardc/Simple.pm 2003-04-09 22:24:44.000000000
+0100
@@ -146,7 +146,7 @@
unless $field =~ /^[\w-]+$/;
}
- if (!exists $self->{header_names}->{$field}) {
+ if (!exists $self->{header_names}->{lc $field}) {
$self->{header_names}->{lc $field} = $field;
# New fields are added to the end.
push @{$self->{order}}, $field;
--
Richard Clamp <richardc@unixbeard.net>