您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Add support to follow HTTP redirects 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>
9 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Manifest-Version: 1.0
  2. Bundle-ManifestVersion: 2
  3. Bundle-Name: %Bundle-Name
  4. Automatic-Module-Name: org.eclipse.jgit.junit.http
  5. Bundle-SymbolicName: org.eclipse.jgit.junit.http
  6. Bundle-Version: 5.13.0.qualifier
  7. Bundle-Localization: plugin
  8. Bundle-Vendor: %Bundle-Vendor
  9. Bundle-ActivationPolicy: lazy
  10. Bundle-RequiredExecutionEnvironment: JavaSE-1.8
  11. Import-Package: javax.servlet;version="[2.5.0,3.2.0)",
  12. javax.servlet.http;version="[2.5.0,3.2.0)",
  13. org.apache.commons.logging;version="[1.1.1,2.0.0)",
  14. org.eclipse.jetty.http;version="[9.4.5,10.0.0)",
  15. org.eclipse.jetty.security;version="[9.4.5,10.0.0)",
  16. org.eclipse.jetty.security.authentication;version="[9.4.5,10.0.0)",
  17. org.eclipse.jetty.server;version="[9.4.5,10.0.0)",
  18. org.eclipse.jetty.server.handler;version="[9.4.5,10.0.0)",
  19. org.eclipse.jetty.server.nio;version="[9.4.5,10.0.0)",
  20. org.eclipse.jetty.servlet;version="[9.4.5,10.0.0)",
  21. org.eclipse.jetty.util.component;version="[9.4.5,10.0.0)",
  22. org.eclipse.jetty.util.log;version="[9.4.5,10.0.0)",
  23. org.eclipse.jetty.util.security;version="[9.4.5,10.0.0)",
  24. org.eclipse.jetty.util.ssl;version="[9.4.5,10.0.0)",
  25. org.eclipse.jgit.errors;version="[5.13.0,5.14.0)",
  26. org.eclipse.jgit.http.server;version="[5.13.0,5.14.0)",
  27. org.eclipse.jgit.internal.storage.file;version="[5.13.0,5.14.0)",
  28. org.eclipse.jgit.junit;version="[5.13.0,5.14.0)",
  29. org.eclipse.jgit.lib;version="[5.13.0,5.14.0)",
  30. org.eclipse.jgit.revwalk;version="[5.13.0,5.14.0)",
  31. org.eclipse.jgit.transport;version="[5.13.0,5.14.0)",
  32. org.eclipse.jgit.transport.resolver;version="[5.13.0,5.14.0)",
  33. org.junit;version="[4.13,5.0.0)"
  34. Export-Package: org.eclipse.jgit.junit.http;version="5.13.0";
  35. uses:="org.eclipse.jgit.transport,
  36. org.eclipse.jgit.junit,
  37. javax.servlet.http,
  38. org.eclipse.jgit.lib,
  39. org.eclipse.jgit.revwalk,
  40. org.eclipse.jetty.server.handler,
  41. org.eclipse.jetty.security,
  42. javax.servlet,
  43. org.eclipse.jetty.server,
  44. org.eclipse.jetty.util.log,
  45. org.eclipse.jetty.servlet"