mirror of
https://github.com/etesync/android
synced 2025-03-08 03:07:43 +00:00
Ensure trailing slash on user-given base URL (assuming users will always provide collections or base paths)
This commit is contained in:
parent
e9901f38f5
commit
69c94c8d93
@ -12,6 +12,7 @@ import ezvcard.VCardVersion;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import at.bitfire.davdroid.R;
|
import at.bitfire.davdroid.R;
|
||||||
|
import at.bitfire.davdroid.URIUtils;
|
||||||
import at.bitfire.davdroid.webdav.DavException;
|
import at.bitfire.davdroid.webdav.DavException;
|
||||||
import at.bitfire.davdroid.webdav.DavHttpClient;
|
import at.bitfire.davdroid.webdav.DavHttpClient;
|
||||||
import at.bitfire.davdroid.webdav.DavIncapableException;
|
import at.bitfire.davdroid.webdav.DavIncapableException;
|
||||||
@ -27,8 +28,9 @@ public class DavResourceFinder {
|
|||||||
// disable compression and enable network logging for debugging purposes
|
// disable compression and enable network logging for debugging purposes
|
||||||
CloseableHttpClient httpClient = DavHttpClient.create(true, true);
|
CloseableHttpClient httpClient = DavHttpClient.create(true, true);
|
||||||
|
|
||||||
WebDavResource base = new WebDavResource(httpClient, new URI(serverInfo.getProvidedURL()), serverInfo.getUserName(),
|
WebDavResource base = new WebDavResource(httpClient,
|
||||||
serverInfo.getPassword(), serverInfo.isAuthPreemptive());
|
new URI(URIUtils.ensureTrailingSlash(serverInfo.getProvidedURL())),
|
||||||
|
serverInfo.getUserName(), serverInfo.getPassword(), serverInfo.isAuthPreemptive());
|
||||||
|
|
||||||
// CardDAV
|
// CardDAV
|
||||||
WebDavResource principal = getCurrentUserPrincipal(base, "carddav");
|
WebDavResource principal = getCurrentUserPrincipal(base, "carddav");
|
||||||
@ -159,6 +161,7 @@ public class DavResourceFinder {
|
|||||||
} catch (DavException e) {
|
} catch (DavException e) {
|
||||||
Log.d(TAG, "DAV error when querying principal for " + serviceName + " service", e);
|
Log.d(TAG, "DAV error when querying principal for " + serviceName + " service", e);
|
||||||
}
|
}
|
||||||
|
Log.i(TAG, "Couldn't find current-user-principal for service " + serviceName);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ public class TlsSniSocketFactory implements LayeredConnectionSocketFactory {
|
|||||||
for (String protocol : ssl.getSupportedProtocols())
|
for (String protocol : ssl.getSupportedProtocols())
|
||||||
if (!protocol.toUpperCase().contains("SSL"))
|
if (!protocol.toUpperCase().contains("SSL"))
|
||||||
protocols.add(protocol);
|
protocols.add(protocol);
|
||||||
Log.d(TAG, "Setting allowed TLS protocols: " + StringUtils.join(protocols, ", "));
|
Log.v(TAG, "Setting allowed TLS protocols: " + StringUtils.join(protocols, ", "));
|
||||||
ssl.setEnabledProtocols(protocols.toArray(new String[0]));
|
ssl.setEnabledProtocols(protocols.toArray(new String[0]));
|
||||||
|
|
||||||
// choose secure cipher suites
|
// choose secure cipher suites
|
||||||
@ -173,7 +173,7 @@ public class TlsSniSocketFactory implements LayeredConnectionSocketFactory {
|
|||||||
HashSet<String> enabledCiphers = new HashSet<String>(Arrays.asList(ssl.getEnabledCipherSuites()));
|
HashSet<String> enabledCiphers = new HashSet<String>(Arrays.asList(ssl.getEnabledCipherSuites()));
|
||||||
enabledCiphers.addAll(preferredCiphers);
|
enabledCiphers.addAll(preferredCiphers);
|
||||||
|
|
||||||
Log.d(TAG, "Setting allowed TLS ciphers: " + StringUtils.join(enabledCiphers, ", "));
|
Log.v(TAG, "Setting allowed TLS ciphers: " + StringUtils.join(enabledCiphers, ", "));
|
||||||
ssl.setEnabledCipherSuites(enabledCiphers.toArray(new String[0]));
|
ssl.setEnabledCipherSuites(enabledCiphers.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,14 +558,13 @@ public class WebDavResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// about which resource is this response?
|
// about which resource is this response?
|
||||||
// "this" resource is either at "location" …
|
if (location.equals(href)) { // about ourselves
|
||||||
if (location.equals(href)) { // -> ourselves
|
|
||||||
this.properties.putAll(properties);
|
this.properties.putAll(properties);
|
||||||
if (supportedComponents != null)
|
if (supportedComponents != null)
|
||||||
this.supportedComponents = supportedComponents;
|
this.supportedComponents = supportedComponents;
|
||||||
this.content = data;
|
this.content = data;
|
||||||
|
|
||||||
} else {
|
} else { // about a member
|
||||||
WebDavResource member = new WebDavResource(this, href);
|
WebDavResource member = new WebDavResource(this, href);
|
||||||
member.properties = properties;
|
member.properties = properties;
|
||||||
member.supportedComponents = supportedComponents;
|
member.supportedComponents = supportedComponents;
|
||||||
|
Loading…
Reference in New Issue
Block a user