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>
This commit is contained in:
parent
0642e49f97
commit
a379d007db
|
@ -133,7 +133,8 @@ public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db,
|
||||||
.toRequest(Protocol.OPERATION_DOWNLOAD, res))
|
.toRequest(Protocol.OPERATION_DOWNLOAD, res))
|
||||||
.getBytes(UTF_8));
|
.getBytes(UTF_8));
|
||||||
int responseCode = lfsServerConn.getResponseCode();
|
int responseCode = lfsServerConn.getResponseCode();
|
||||||
if (responseCode != HttpConnection.HTTP_OK) {
|
if (!(responseCode == HttpConnection.HTTP_OK
|
||||||
|
|| responseCode == HttpConnection.HTTP_NOT_AUTHORITATIVE)) {
|
||||||
throw new IOException(
|
throw new IOException(
|
||||||
MessageFormat.format(LfsText.get().serverFailure,
|
MessageFormat.format(LfsText.get().serverFailure,
|
||||||
lfsServerConn.getURL(),
|
lfsServerConn.getURL(),
|
||||||
|
|
|
@ -7,5 +7,11 @@
|
||||||
<message_argument value="HTTP_11_MOVED_PERM"/>
|
<message_argument value="HTTP_11_MOVED_PERM"/>
|
||||||
</message_arguments>
|
</message_arguments>
|
||||||
</filter>
|
</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>
|
</resource>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -40,6 +40,12 @@ public interface HttpConnection {
|
||||||
*/
|
*/
|
||||||
int HTTP_OK = java.net.HttpURLConnection.HTTP_OK;
|
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
|
* @see HttpURLConnection#HTTP_MOVED_PERM
|
||||||
* @since 4.7
|
* @since 4.7
|
||||||
|
|
Loading…
Reference in New Issue