diff options
author | Sven Selberg <sven.selberg@axis.com> | 2022-04-12 11:36:58 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2022-05-09 22:06:38 +0200 |
commit | 8984e1f663b5b58f74cd0381043133f0059e004d (patch) | |
tree | 1b2826e352f46e10a6e0676316f564ef4a2b1471 /org.eclipse.jgit.http.server/.settings | |
parent | 8f7ef245f0c156730ef74ff3fe838c330728fc7f (diff) | |
download | jgit-8984e1f663b5b58f74cd0381043133f0059e004d.tar.gz jgit-8984e1f663b5b58f74cd0381043133f0059e004d.zip |
HTTP Smart: set correct HTTP status on error
Previous behavior was that status code was automatically set to 200
regardless of reported status and according to HTTP Smart protocol[1]:
If there is no repository at $GIT_URL, or the resource pointed to by
a location matching $GIT_URL does not exist, the server MUST NOT
respond with 200 OK response. A server SHOULD respond with
404 Not Found, 410 Gone, or any other suitable HTTP status code which
does not imply the resource exists as requested.
Since the jgit HTTP client isn't able to handle reading content from a
response reporting an error (calling HttpURLConnection#getInputStream
on a "failed" connection throws an exception and the internal interface
HttpConnection does not expose HttpURLConnection#getErrorStream) the
SmartClientSmartServerTest needed to be rewritten to expect the generic
response messages.
[1] https://git-scm.com/docs/http-protocol#_general_request_processing
Bug: 579676
Change-Id: Ibb942d02124a0bc279df09600b091354019ce064
Diffstat (limited to 'org.eclipse.jgit.http.server/.settings')
0 files changed, 0 insertions, 0 deletions