[ 
https://issues.apache.org/jira/browse/GERONIMO-6871?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Markus Jung updated GERONIMO-6871:
----------------------------------
    Attachment: GERONIMO-6871.patch

> InternetHeaders to rejects well-formed headers
> ----------------------------------------------
>
>                 Key: GERONIMO-6871
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6871
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: Mail_2.1_1.0.0
>            Reporter: Markus Jung
>            Priority: Blocker
>         Attachments: GERONIMO-6871.patch
>
>
> GERONIMO-6870 introduced a bug causing InternetHeaders to reject well-formed 
> headers.
>  
> Some example code says more than 1000 words:
> {code:java}
>     @Test // fails
>     public void returnPathHeader() throws MessagingException {
>         new InternetHeaders(new ByteArrayInputStream("Return-Path: 
> bla".getBytes()), true);
>     }
>     @Test // fails
>     public void receivedHeader() throws MessagingException {
>         new InternetHeaders(new ByteArrayInputStream("Received: 
> bla".getBytes()), true);
>     }
>     @Test // passes
>     public void otherHeaderNotDuplicated() throws MessagingException {
>         new InternetHeaders(new ByteArrayInputStream("Bla: bla".getBytes()), 
> true);
>     }
>     @Test // passes
>     public void actuallyDuplicatedHeader() throws MessagingException {
>         assertThrows(IllegalStateException.class, () -> new 
> InternetHeaders(new ByteArrayInputStream("Bla: bla\nBla: blub".getBytes()), 
> true));
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to