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

ASF GitHub Bot commented on WAGON-432:
--------------------------------------

GitHub user jsievers opened a pull request:

    https://github.com/apache/maven-wagon/pull/19

    [WAGON-432] make sure User-Agent header is sent exactly once

    - remove unnecessary explicit default User-Agent (all 3 HTTP wagon
      providers [http, lightweight, webdav] send a User-Agent by default
      already)
    - when adding headers, use setHeader() instead of addHeader().
      this will avoid sending the same header key multiple times
    - adapt header listener in tests so it will detect header keys
      sent multiple times
    - add tests to make sure default User-Agent is always present and
      User-Agent is present only once even if set multiple times
      using different methods
    
    Signed-off-by: Jan Sievers <[email protected]>

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jsievers/maven-wagon master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-wagon/pull/19.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #19
    
----
commit fadfcd9af264429674457b7696550c59c5059c5c
Author: Jan Sievers <[email protected]>
Date:   2015-04-17T12:31:46Z

    [WAGON-432] make sure User-Agent header is sent exactly once
    
    - remove unnecessary explicit default User-Agent (all 3 HTTP wagon
      providers [http, lightweight, webdav] send a User-Agent by default
      already)
    - when adding headers, use setHeader() instead of addHeader().
      this will avoid sending the same header key multiple times
    - adapt header listener in tests so it will detect header keys
      sent multiple times
    - add tests to make sure default User-Agent is always present and
      User-Agent is present only once even if set multiple times
      using different methods
    
    Signed-off-by: Jan Sievers <[email protected]>

----


> 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