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:
parent
ca8d595493
commit
d741b6ff66
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user