aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server/src/org
diff options
context:
space:
mode:
authorJosh Brown <sjoshbrown@google.com>2022-10-11 14:56:09 -0700
committerIvan Frade <ifrade@google.com>2022-10-27 16:17:50 -0400
commit93097f001854af47db782462e78d67e7171043a4 (patch)
treef9b33a9695fc9cef5478e0930b9d00c3182de272 /org.eclipse.jgit.http.server/src/org
parentad9c217f4954dc50f629b3eb6ae387b6940a5023 (diff)
downloadjgit-93097f001854af47db782462e78d67e7171043a4.tar.gz
jgit-93097f001854af47db782462e78d67e7171043a4.zip
ReceivePack: Receive and parse client session-id.
Before this change JGit did not support the session-id capability implemented by native Git. This change implements advertising the capability from the server and parsing the session-id received from the client during a ReceivePack operation. Enable the transfer.advertisesid config setting to advertise the capability from the server. The client may send a session-id capability in response. If received, the value from this is parsed and available via the getClientSID method on the ReceivePack object. All capabilities in the form `capability=value` are now split into key value pairs at the first `=` character. This change replaces specific handling for the agent capability. This change does not add advertisement or parsing to UploadPack. This change also does not add the ability to send a session ID from the JGit client. https://git-scm.com/docs/protocol-v2/2.33.0#_session_idsession_id Change-Id: I56fb115e843b11b27e128c4ac427b05d5ec129d0 Signed-off-by: Josh Brown <sjoshbrown@google.com>
Diffstat (limited to 'org.eclipse.jgit.http.server/src/org')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
index f1155dcf57..078b22a700 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java
@@ -226,7 +226,8 @@ public class GitSmartHttpTools {
// So, cheat and read the first line.
String line = new PacketLineIn(req.getInputStream()).readString();
FirstCommand parsed = FirstCommand.fromLine(line);
- return parsed.getCapabilities().contains(CAPABILITY_SIDE_BAND_64K);
+ return parsed.getCapabilities()
+ .containsKey(CAPABILITY_SIDE_BAND_64K);
} catch (IOException e) {
// Probably the connection is closed and a subsequent write will fail, but
// try it just in case.