From 293a9407717e285d9bb77e8fc1aba82f3d2abcb3 Mon Sep 17 00:00:00 2001 From: Jackson Tomlinson Date: Thu, 1 Jan 2026 22:51:54 -0600 Subject: [PATCH] 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. --- plugins/amcrest/src/amcrest-api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/amcrest/src/amcrest-api.ts b/plugins/amcrest/src/amcrest-api.ts index 9a962d2eb..597924cce 100644 --- a/plugins/amcrest/src/amcrest-api.ts +++ b/plugins/amcrest/src/amcrest-api.ts @@ -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('');