From 1092f6340d3db80e3c9c57e98d7b059f53054b6d Mon Sep 17 00:00:00 2001 From: PTah Date: Thu, 28 May 2026 09:13:14 +1000 Subject: [PATCH] fix: accept SAC ingest HTTP 201, 409, and legacy 202 Remove .cursorignore (patterns covered by repo hygiene elsewhere) --- .cursorignore | 65 -------------------------------------------------- Sac-Client.ps1 | 4 ++-- 2 files changed, 2 insertions(+), 67 deletions(-) delete mode 100644 .cursorignore diff --git a/.cursorignore b/.cursorignore deleted file mode 100644 index f5740f9..0000000 --- a/.cursorignore +++ /dev/null @@ -1,65 +0,0 @@ -# Зависимости и пакеты -node_modules/ -bower_components/ -jspm_packages/ -.npm/ -vendor/ -.pnpm-store/ - -# Виртуальные окружения (Python) -.venv/ -venv/ -env/ -ENV/ -.env/ - -# Сборка, кэш и артефакты -dist/ -build/ -out/ -.next/ -.nuxt/ -.docusaurus/ -.cache/ -.sass-cache/ -.turbo/ -target/ -bin/ -obj/ - -# Системные папки IDE и логи -.git/ -.svn/ -.idea/ -.vscode/ -.cursor/ -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Медиа, шрифты и тяжелые бинарные файлы -*.png -*.jpg -*.jpeg -*.gif -*.svg -*.ico -*.mp4 -*.mp3 -*.pdf -*.zip -*.tar.gz -*.rar -*.exe -*.dll -*.woff -*.woff2 -*.ttf -*.eot - -# Сгенерированные файлы блокировок (опционально, экономят много токенов) -package-lock.json -yarn.lock -pnpm-lock.yaml -poetry.lock diff --git a/Sac-Client.ps1 b/Sac-Client.ps1 index e521443..14e0892 100644 --- a/Sac-Client.ps1 +++ b/Sac-Client.ps1 @@ -225,7 +225,7 @@ function Invoke-SacPostPayload { 'Idempotency-Key' = $eventId } $resp = Invoke-WebRequest -Uri $ingest -Method Post -Headers $headers -Body $JsonBody -UseBasicParsing -TimeoutSec $timeout - if ($resp.StatusCode -eq 202) { + if ($resp.StatusCode -in 201, 409, 202) { Remove-SacSpoolFile -EventId $eventId Reset-SacFailCount Write-SacLog "SAC: accepted event_id=$eventId type=$eventType" @@ -393,7 +393,7 @@ function Test-SacConnection { return 1 } if (Send-SacEvent -EventType 'agent.test' -Severity 'info' -Title 'SAC test' -Summary 'rdp-login-monitor CheckSac') { - Write-Host 'SAC ingest agent.test: OK (expected HTTP 202)' + Write-Host 'SAC ingest agent.test: OK (expected HTTP 201)' return 0 } Write-Error 'SAC ingest agent.test: FAIL'