Skip to content

Commit

Permalink
Allow headers with whitespace prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Aug 15, 2014
1 parent f1f1abb commit c3e6971
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Courriel/Header.pm
Expand Up @@ -64,6 +64,8 @@ sub as_string {
{
my $header_chunk = qr/
(?:
^
|
(?<ascii>[\x21-\x7e]+) # printable ASCII (excluding space, \x20)
|
(?<non_ascii>\S+) # anything that's not space
Expand Down
12 changes: 12 additions & 0 deletions t/Headers.t
Expand Up @@ -141,6 +141,18 @@ EOF
);
}

{
my $h = Courriel::Headers->new();

$h->add( Subject => ' test' );

is(
$h->as_string,
"Subject: test\r\n",
'Headers prefixed by whitespace are not blank'
);
}

{
my ( $val, $attrs )
= Courriel::Helpers::parse_header_with_attributes(
Expand Down

0 comments on commit c3e6971

Please sign in to comment.