mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-01 06:22:55 +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);
|
LOG.debug("agps request hash = {}, file hash = {}", ifNoneMatch, etag);
|
||||||
|
|
||||||
if (etag.equals(ifNoneMatch)) {
|
if (etag.equals(ifNoneMatch)) {
|
||||||
response.setStatus(304);
|
// FIXME: the 304 reboots some watches, so just ignore the request if the hash matches
|
||||||
return response;
|
//response.setStatus(304);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,9 @@ public class HttpHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
return null;
|
return GdiHttpService.HttpService.RawResponse.newBuilder()
|
||||||
|
.setStatus(GdiHttpService.HttpService.Status.UNKNOWN_STATUS)
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.debug("Http response status={}", response.getStatus());
|
LOG.debug("Http response status={}", response.getStatus());
|
||||||
|
@ -87,9 +87,7 @@ public class WeatherHandler {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
LOG.warn("Unknown weather path {}", path);
|
LOG.warn("Unknown weather path {}", path);
|
||||||
final GarminHttpResponse response = new GarminHttpResponse();
|
return null;
|
||||||
response.setStatus(404);
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final String json = GSON.toJson(weatherData);
|
final String json = GSON.toJson(weatherData);
|
||||||
|
Loading…
Reference in New Issue
Block a user