Browse Source

Fix downloading LFS Object fails behind proxy

When downloading LFS objects also accept response code 203 as successful
download. This response may be seen when downloading via a proxy.

Bug: 563022
Change-Id: Iee85fdb451b33369d08859872e5bfc2a67dffa6d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
master
Matthias Sohn 5 years ago
parent
commit
a379d007db
  1. 3
      org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java
  2. 6
      org.eclipse.jgit/.settings/.api_filters
  3. 6
      org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java

3
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java

@ -133,7 +133,8 @@ public class SmudgeFilter extends FilterCommand {
.toRequest(Protocol.OPERATION_DOWNLOAD, res))
.getBytes(UTF_8));
int responseCode = lfsServerConn.getResponseCode();
if (responseCode != HttpConnection.HTTP_OK) {
if (!(responseCode == HttpConnection.HTTP_OK
|| responseCode == HttpConnection.HTTP_NOT_AUTHORITATIVE)) {
throw new IOException(
MessageFormat.format(LfsText.get().serverFailure,
lfsServerConn.getURL(),

6
org.eclipse.jgit/.settings/.api_filters

@ -7,5 +7,11 @@
<message_argument value="HTTP_11_MOVED_PERM"/>
</message_arguments>
</filter>
<filter id="403767336">
<message_arguments>
<message_argument value="org.eclipse.jgit.transport.http.HttpConnection"/>
<message_argument value="HTTP_NOT_AUTHORITATIVE"/>
</message_arguments>
</filter>
</resource>
</component>

6
org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java

@ -40,6 +40,12 @@ public interface HttpConnection {
*/
int HTTP_OK = java.net.HttpURLConnection.HTTP_OK;
/**
* @see HttpURLConnection#HTTP_NOT_AUTHORITATIVE
* @since 5.8
*/
int HTTP_NOT_AUTHORITATIVE = java.net.HttpURLConnection.HTTP_NOT_AUTHORITATIVE;
/**
* @see HttpURLConnection#HTTP_MOVED_PERM
* @since 4.7

Loading…
Cancel
Save