Garmin: Ignore agps request if etag matches

Some watches reboot on http 304
This commit is contained in:
José Rebelo
2024-05-24 22:24:09 +02:00
committed by Daniele Gobbetti
parent ca8d595493
commit d741b6ff66
3 changed files with 7 additions and 6 deletions
@@ -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;
}
}
@@ -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());
@@ -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);