From e218ed3cd4fa3c1630ba15faacc23774c40543d0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 23 Jul 2016 00:58:59 +1200 Subject: Return http error if unknown --- src/org/traccar/protocol/OsmAndProtocolDecoder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index da502ca65..12192c457 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -64,6 +64,9 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { case "deviceid": DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, value); if (deviceSession == null) { + if (channel != null) { + channel.write(new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST)); + } return null; } position.setDeviceId(deviceSession.getDeviceId()); -- cgit v1.2.3