mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 06:03:27 +00:00
amcrest: handle HTTP/1.0 responses in event listener (#1957)
Some Dahua/Amcrest NVRs (e.g., AMDV7208M) respond with HTTP/1.0 instead of HTTP/1.1. The event listener was only checking for 'HTTP/1.1 200 OK', causing it to throw 'expected boundary' errors and crash when receiving HTTP/1.0 responses. This fix adds support for both HTTP versions. Fixes motion detection not working on older Dahua OEM NVRs.
This commit is contained in:
committed by
GitHub
parent
67728883cc
commit
293a940771
@@ -268,8 +268,8 @@ export class AmcrestCameraClient {
|
||||
continue;
|
||||
if (ignore === boundaryEnd)
|
||||
continue;
|
||||
// dahua bugs out and sends this.
|
||||
if (ignore === 'HTTP/1.1 200 OK') {
|
||||
// dahua bugs out and sends this (handle both HTTP/1.0 and HTTP/1.1).
|
||||
if (ignore === 'HTTP/1.1 200 OK' || ignore === 'HTTP/1.0 200 OK') {
|
||||
const message = await readAmcrestMessage(stream);
|
||||
this.console.log('ignoring dahua http message', message);
|
||||
message.unshift('');
|
||||
|
||||
Reference in New Issue
Block a user