mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Fixed logic of HTTPS downgrade detection for multiple redirections, and grant that redirection if followed for HTTP servers
This commit is contained in:
parent
07f3d9caae
commit
e43e43f51a
@ -85,12 +85,14 @@ public class GetRemoteStatusOperation extends RemoteOperation {
|
||||
get.getResponseHeaders()
|
||||
);
|
||||
|
||||
if (baseUrlSt.startsWith("https://")) {
|
||||
String redirectedLocation = mLatestResult.getRedirectedLocation();
|
||||
while (redirectedLocation != null && redirectedLocation.length() > 0
|
||||
&& !mLatestResult.isSuccess()) {
|
||||
|
||||
isRedirectToNonSecureConnection = redirectedLocation.startsWith("http://");
|
||||
isRedirectToNonSecureConnection |= (
|
||||
baseUrlSt.startsWith("https://") &&
|
||||
redirectedLocation.startsWith("http://")
|
||||
);
|
||||
get.releaseConnection();
|
||||
get = new GetMethod(redirectedLocation);
|
||||
status = client.executeMethod(
|
||||
@ -103,7 +105,6 @@ public class GetRemoteStatusOperation extends RemoteOperation {
|
||||
);
|
||||
redirectedLocation = mLatestResult.getRedirectedLocation();
|
||||
}
|
||||
}
|
||||
|
||||
String response = get.getResponseBodyAsString();
|
||||
if (status == HttpStatus.SC_OK) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user