]> source.dussan.org Git - jgit.git/commit
UploadPack: Return correct peer user agent on v2 requests 48/131148/10
authorIvan Frade <ifrade@google.com>
Wed, 17 Oct 2018 23:52:30 +0000 (16:52 -0700)
committerIvan Frade <ifrade@google.com>
Fri, 19 Oct 2018 23:55:56 +0000 (16:55 -0700)
commit8d4f8d55d3d14b51983f951568a2f4e4ff64b324
tree6394f4bc0166e81f7553ba31f8274959925ef997
parent40f5b28545989f7e200f6e0b2007459d63279103
UploadPack: Return correct peer user agent on v2 requests

UploadPack.getPeerUserAgent() doesn't produce the expected results for
protocol v2 requests. In v2, the agent reported in the request (in an
"agent=" line) is not in the clientCapabilities but in a field on its
own. This makes getPeerUserAgent default to the transport user agent.

Making "agent" a shared property between protocol v0/v1 and v2 fixes the
problem, simplifies the function and harmonizes the implementation
between protocol versions.

In a follow up commit the "agent" will be identified on parsing time,
instead of taking it from the client capabilities.

Change-Id: Idf9825ec4e0b81a1458c8e3701f3e28aafd8a32a
Signed-off-by: Ivan Frade <ifrade@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchRequest.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV0Request.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchV2Request.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java