mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-27 12:15:50 +01:00
Restore timestamp instead of tier during manual registration remote backup restore flow.
This commit is contained in:
@@ -200,8 +200,7 @@ public class SignalServiceMessageReceiver {
|
||||
socket.retrieveBackup(cdnNumber, headers, cdnPath, destination, 1_000_000_000L, listener);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ZonedDateTime getCdnLastModifiedTime(int cdnNumber, Map<String, String> headers, String cdnPath) throws MissingConfigurationException, IOException {
|
||||
public @Nonnull ZonedDateTime getCdnLastModifiedTime(int cdnNumber, Map<String, String> headers, String cdnPath) throws MissingConfigurationException, IOException {
|
||||
return socket.getCdnLastModifiedTime(cdnNumber, headers, cdnPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -677,8 +677,7 @@ public class PushServiceSocket {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ZonedDateTime getCdnLastModifiedTime(int cdnNumber, Map<String, String> headers, String path) throws MissingConfigurationException, PushNetworkException, NonSuccessfulResponseCodeException {
|
||||
public @Nonnull ZonedDateTime getCdnLastModifiedTime(int cdnNumber, Map<String, String> headers, String path) throws MissingConfigurationException, PushNetworkException, NonSuccessfulResponseCodeException, MalformedResponseException {
|
||||
ConnectionHolder[] cdnNumberClients = cdnClientsMap.get(cdnNumber);
|
||||
if (cdnNumberClients == null) {
|
||||
throw new MissingConfigurationException("Attempted to download from unsupported CDN number: " + cdnNumber + ", Our configuration supports: " + cdnClientsMap.keySet());
|
||||
@@ -690,7 +689,7 @@ public class PushServiceSocket {
|
||||
.readTimeout(soTimeoutMillis, TimeUnit.MILLISECONDS)
|
||||
.build();
|
||||
|
||||
Request.Builder request = new Request.Builder().url(connectionHolder.getUrl() + "/" + path).get();
|
||||
Request.Builder request = new Request.Builder().url(connectionHolder.getUrl() + "/" + path).head();
|
||||
|
||||
if (connectionHolder.getHostHeader().isPresent()) {
|
||||
request.addHeader("Host", connectionHolder.getHostHeader().get());
|
||||
@@ -710,7 +709,7 @@ public class PushServiceSocket {
|
||||
if (response.isSuccessful()) {
|
||||
String lastModified = response.header("Last-Modified");
|
||||
if (lastModified == null) {
|
||||
return null;
|
||||
throw new MalformedResponseException("No Last-Modified header in response");
|
||||
}
|
||||
return ZonedDateTime.parse(lastModified, DateTimeFormatter.RFC_1123_DATE_TIME);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user