do only compress gpx/json

This commit is contained in:
afischerdev 2023-12-15 14:01:13 +01:00
parent bcf6a7f630
commit 158dc5e54d

View file

@ -100,7 +100,7 @@ public class BRouterService extends Service {
boolean canCompress = "true".equals(params.getString("acceptCompressedResult"));
try {
String gpxMessage = worker.getTrackFromParams(params);
if (canCompress) {
if (canCompress && (gpxMessage.startsWith("<") || gpxMessage.startsWith("{"))) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write("z64".getBytes(Charset.forName("UTF-8"))); // marker prefix