aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
diff options
context:
space:
mode:
authorBo Zhang <zhangbodut@gmail.com>2017-01-16 14:19:17 +0800
committerDavid Pursehouse <david.pursehouse@gmail.com>2017-02-02 21:20:23 -0400
commitd4bd09b78daa733933a15733bc6ebbaa0a0485f1 (patch)
tree85226e94dbcf38692b8f2e7f54dde4659873a772 /org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
parent566794d00152c65bfaf9af7eb7de4198664bd692 (diff)
downloadjgit-d4bd09b78daa733933a15733bc6ebbaa0a0485f1.tar.gz
jgit-d4bd09b78daa733933a15733bc6ebbaa0a0485f1.zip
Follow redirects in transport
Bug: 465167 Change-Id: I6da19c8106201c2a1ac69002bd633b7387f25d96 Signed-off-by: Bo Zhang <zhangbodut@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
index 251381ab33..9f828adc20 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
@@ -141,6 +141,12 @@ public class HttpSupport {
/** The {@code Accept-Encoding} header. */
public static final String HDR_ACCEPT_ENCODING = "Accept-Encoding"; //$NON-NLS-1$
+ /**
+ * The {@code Location} header.
+ * @since 4.7
+ */
+ public static final String HDR_LOCATION = "Location"; //$NON-NLS-1$
+
/** The {@code gzip} encoding value for {@link #HDR_ACCEPT_ENCODING}. */
public static final String ENCODING_GZIP = "gzip"; //$NON-NLS-1$
@@ -235,6 +241,23 @@ public class HttpSupport {
}
/**
+ * Extract a HTTP header from the response.
+ *
+ * @param c
+ * connection the header should be obtained from.
+ * @param headerName
+ * the header name
+ * @return the header value
+ * @throws IOException
+ * communications error prevented obtaining the header.
+ * @since 4.7
+ */
+ public static String responseHeader(final HttpConnection c,
+ final String headerName) throws IOException {
+ return c.getHeaderField(headerName);
+ }
+
+ /**
* Determine the proxy server (if any) needed to obtain a URL.
*
* @param proxySelector