[ 
https://issues.apache.org/jira/browse/WAGON-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14499900#comment-14499900
 ] 

Jan Sievers commented on WAGON-432:
-----------------------------------

@Michael yes I know. To fix the issue in general for all HTTP headers I guess 
you would have to replace all addHeader() calls with setHeader() throughout the 
wagon codebase.

If you check the unit tests I provided with my fix, this is verified for header 
User-Agent only.
I did verify that header User-Agent is now only set using setHeader(), not 
addHeader() throughout the wagon codebase.

I just wanted to keep the fix focused on the concrete issue here and not bloat 
it with hypothetic problems for other headers in other places which I'm not 
entirely sure about. If you are familiar enough with the rest of the HTTP 
headers, feel free to fix the rest on top of my patch.

> Maven sends duplicate User-Agent header
> ---------------------------------------
>
>                 Key: WAGON-432
>                 URL: https://issues.apache.org/jira/browse/WAGON-432
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-http
>    Affects Versions: 2.8
>            Reporter: Michael Osipov
>            Priority: Minor
>         Attachments: 
> 0001-WAGON-432-do-not-set-User-Agent-header-by-default.patch, 
> headergroup-after-setHeaders.png, headergroup-after-setUserAgent.png, 
> headergroup-before-execution.png, maven-3.1.1.png, maven-3.2.2.png
>
>
> Maven 3.1.1 sends only one {{User-Agent}} header, 3.2.2 sends twice. See 
> screenshots.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to