Bug 560936 - 308 redirects not followed
Summary: 308 redirects not followed
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 5.8   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 560935 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-03-09 12:10 EDT by kieran geoghegan CLA
Modified: 2020-03-10 08:54 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kieran geoghegan CLA 2020-03-09 12:10:49 EDT
With followRedirects set to true, 308 redirects are not followed (e.g. if git server is behind the nip.io service)
Looks like this block:

case HttpConnection.HTTP_MOVED_PERM:
case HttpConnection.HTTP_MOVED_TEMP:
case HttpConnection.HTTP_SEE_OTHER:
case HttpConnection.HTTP_11_MOVED_TEMP:

in org.eclipse.jgit.transport.TransportHttp.connect  should include the 308 code and it does not.
Comment 1 Thomas Wolf CLA 2020-03-09 16:00:55 EDT
*** Bug 560935 has been marked as a duplicate of this bug. ***
Comment 2 Eclipse Genie CLA 2020-03-10 02:43:10 EDT
New Gerrit change created: https://git.eclipse.org/r/159094
Comment 3 Eclipse Genie CLA 2020-03-10 08:10:38 EDT
Gerrit change https://git.eclipse.org/r/159094 was merged to [master].
Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=04e16afb05912f3a163d8cda3560a5b2f1ea997f
Comment 4 Thomas Wolf CLA 2020-03-10 08:54:13 EDT
Will be fixed in JGit 5.8.0, scheduled for June 2020.

Please note https://tools.ietf.org/html/rfc7538#section-4 :

   Thus, servers will not be able to rely on automatic redirection happening
   similar to status codes 301, 302, or 307.

   Therefore, the use of status code 308 is restricted to cases where
   the server has sufficient confidence in the client's understanding
   the new code or when a fallback to the semantics of status code 300
   is not problematic.

JGit doesn't handle response code 300 Multiple Choices.