diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-23 00:58:59 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-23 00:58:59 +1200 |
commit | e218ed3cd4fa3c1630ba15faacc23774c40543d0 (patch) | |
tree | 9e214afeb310cf92956ce2cfb01d7b729d0dc6e0 /src | |
parent | c92f37404893cce14a25379bcd84bb081e94f1b8 (diff) | |
download | trackermap-server-e218ed3cd4fa3c1630ba15faacc23774c40543d0.tar.gz trackermap-server-e218ed3cd4fa3c1630ba15faacc23774c40543d0.tar.bz2 trackermap-server-e218ed3cd4fa3c1630ba15faacc23774c40543d0.zip |
Return http error if unknown
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 3 |
1 files changed, 3 insertions, 0 deletions
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()); |