From 56a7dedea297154907449c24feb549301dd9d878 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 14:09:09 +0000 Subject: [PATCH 1/2] Initial plan From e44a17574880611f49c30d5f8020f8dfab422c92 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 14:11:34 +0000 Subject: [PATCH 2/2] test: add max length validation test for NoSQL detector Co-authored-by: hyp3rd <62474964+hyp3rd@users.noreply.github.com> --- pkg/sanitize/nosql_detect_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/sanitize/nosql_detect_test.go b/pkg/sanitize/nosql_detect_test.go index 28c6bd0..c43a174 100644 --- a/pkg/sanitize/nosql_detect_test.go +++ b/pkg/sanitize/nosql_detect_test.go @@ -35,3 +35,15 @@ func TestNoSQLInjectionDetectorCustomOperators(t *testing.T) { t.Fatalf("expected ErrNoSQLInjectionDetected, got %v", err) } } + +func TestNoSQLInjectionDetectorMaxLength(t *testing.T) { + detector, err := NewNoSQLInjectionDetector(WithNoSQLDetectMaxLength(1)) + if err != nil { + t.Fatalf("expected detector, got %v", err) + } + + err = detector.Detect("ab") + if err != ErrNoSQLInputTooLong { + t.Fatalf("expected ErrNoSQLInputTooLong, got %v", err) + } +}