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:
Jackson Tomlinson
2026-01-01 22:51:54 -06:00
committed by GitHub
parent 67728883cc
commit 293a940771

View File

@@ -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('');