1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Garmin: Ignore agps request if etag matches

Some watches reboot on http 304
This commit is contained in:
José Rebelo 2024-05-19 17:58:40 +01:00 committed by Daniele Gobbetti
parent ca8d595493
commit d741b6ff66
3 changed files with 7 additions and 6 deletions

View File

@ -62,8 +62,9 @@ public class AgpsHandler {
LOG.debug("agps request hash = {}, file hash = {}", ifNoneMatch, etag);
if (etag.equals(ifNoneMatch)) {
response.setStatus(304);
return response;
// FIXME: the 304 reboots some watches, so just ignore the request if the hash matches
//response.setStatus(304);
return null;
}
}

View File

@ -63,7 +63,9 @@ public class HttpHandler {
}
if (response == null) {
return null;
return GdiHttpService.HttpService.RawResponse.newBuilder()
.setStatus(GdiHttpService.HttpService.Status.UNKNOWN_STATUS)
.build();
}
LOG.debug("Http response status={}", response.getStatus());

View File

@ -87,9 +87,7 @@ public class WeatherHandler {
}
default:
LOG.warn("Unknown weather path {}", path);
final GarminHttpResponse response = new GarminHttpResponse();
response.setStatus(404);
return response;
return null;
}
final String json = GSON.toJson(weatherData);