summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.test/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix javadoc in org.eclipse.jgit.http.testMatthias Sohn2017-12-172-3/+7
| | | | | Change-Id: Ibd18dfed05d35bd70498d11c04c026a34114a87e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* dfs: Switch InMemoryRepository to DfsReftableDatabaseShawn Pearce2017-10-181-4/+3
| | | | | | | | | | | This ensure DfsReftableDatabase is tested by the same test suites that use/test InMemoryRepository. It also simplifies the logic of InMemoryRepository and brings its compatibility story closer to any other DFS repository that uses reftables for its reference storage. Change-Id: I881469fd77ed11a9239b477633510b8c482a19ca Signed-off-by: Minh Thai <mthai@google.com> Signed-off-by: Terry Parker <tparker@google.com>
* Add support to follow HTTP redirectsThomas Wolf2017-08-171-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-core follows HTTP redirects so JGit should also provide this. Implement config setting http.followRedirects with possible values "false" (= never), "true" (= always), and "initial" (only on GET, but not on POST).[1] We must do our own redirect handling and cannot rely on the support that the underlying real connection may offer. At least the JDK's HttpURLConnection has two features that get in the way: * it does not allow cross-protocol redirects and thus fails on http->https redirects (for instance, on Github). * it translates a redirect after a POST to a GET unless the system property "http.strictPostRedirect" is set to true. We don't want to manipulate that system setting nor require it. Additionally, git has its own rules about what redirects it accepts;[2] for instance, it does not allow a redirect that adds query arguments. We handle response codes 301, 302, 303, and 307 as per RFC 2616.[3] On POST we do not handle 303, and we follow redirects only if http.followRedirects == true. Redirects are followed only a certain number of times. There are two ways to control that limit: * by default, the limit is given by the http.maxRedirects system property that is also used by the JDK. If the system property is not set, the default is 5. (This is much lower than the JDK default of 20, but I don't see the value of following so many redirects.) * this can be overwritten by a http.maxRedirects git config setting. The JGit http.* git config settings are currently all global; JGit has no support yet for URI-specific settings "http.<pattern>.name". Adding support for that is well beyond the scope of this change. Like git-core, we log every redirect attempt (LOG.info) so that users may know about the redirection having occurred. Extends the test framework to configure an AppServer with HTTPS support so that we can test cloning via HTTPS and redirections involving HTTPS. [1] https://git-scm.com/docs/git-config [2] https://kernel.googlesource.com/pub/scm/git/git/+/6628eb41db5189c0cdfdced6d8697e7c813c5f0f [3] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html CQ: 13987 Bug: 465167 Change-Id: I86518cb76842f7d326b51f8715e3bbf8ada89859 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Fix RefsUnreadableInMemoryRepositoryMatthias Sohn2016-04-161-1/+42
| | | | | | | | - fix classpath for Eclipse - add missing license header - remove unused import Change-Id: If491fe60678f050f86319388170ac789085fcf5f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix Buck build broken by 4812fda.Mike Edgar2016-04-141-0/+52
Creates a source directory under org.eclipse.jgit.http.test for the new support class. Signed-off-by: Michael Edgar <adgar@google.com> Change-Id: Ie49492c2bbe5c1db96ceb0dc06fa7cb9f927431a