jgit (Gerrit) does not follow HTTP Smart protocol

75 views
Skip to first unread message

Sven Selberg

unread,
Apr 12, 2022, 5:59:30 AM4/12/22
to Repo and Gerrit Discussion
Hi,

It was brought to my attention by a colleague of mine, who is working on integrating with Gerrit using go-git, that Gerrit doesn't follow HTTP Smart protocol.
Regardless of http status code that is reported (404 missing in this particular case) the GitSmartHttpTool always responds to the client with 200 [1].

I have uploaded a fix [2] for jgit:master to describe what might be a suitable solution to this.
I'd consider it a bug-fix but I don't normally contribute to jgit and feel a bit lost as to where/how to fix it.

/Sven

Sven Selberg

unread,
Apr 12, 2022, 8:01:28 AM4/12/22
to Repo and Gerrit Discussion
On Tuesday, April 12, 2022 at 11:59:30 AM UTC+2 Sven Selberg wrote:
Hi,

It was brought to my attention by a colleague of mine, who is working on integrating with Gerrit using go-git, that Gerrit doesn't follow HTTP Smart protocol.
Regardless of http status code that is reported (404 missing in this particular case) the GitSmartHttpTool always responds to the client with 200 [1].

I have uploaded a fix [2] for jgit:master to describe what might be a suitable solution to this.
I'd consider it a bug-fix but I don't normally contribute to jgit and feel a bit lost as to where/how to fix it.

Sven Selberg

unread,
May 9, 2022, 8:21:16 AM5/9/22
to Repo and Gerrit Discussion
On Tuesday, April 12, 2022 at 2:01:28 PM UTC+2 Sven Selberg wrote:
On Tuesday, April 12, 2022 at 11:59:30 AM UTC+2 Sven Selberg wrote:
Hi,

It was brought to my attention by a colleague of mine, who is working on integrating with Gerrit using go-git, that Gerrit doesn't follow HTTP Smart protocol.
Regardless of http status code that is reported (404 missing in this particular case) the GitSmartHttpTool always responds to the client with 200 [1].

I have uploaded a fix [2] for jgit:master to describe what might be a suitable solution to this.
I'd consider it a bug-fix but I don't normally contribute to jgit and feel a bit lost as to where/how to fix it.

Submitted as a bug to jgit: 

Also uploaded a fix, if someone has the time to review it:
https://git.eclipse.org/r/c/jgit/jgit/+/192677 
Reply all
Reply to author
Forward
0 new messages