@@ -242,6 +242,8 @@ func TestHandleScanRejectsBadQueryAndMethod(t *testing.T) {
242242 {name : "wrong method" , method : http .MethodPost , target : "/scan" , want : http .StatusMethodNotAllowed },
243243 {name : "bad limit" , method : http .MethodGet , target : "/scan?limit=many" , want : http .StatusBadRequest },
244244 {name : "bad reverse" , method : http .MethodGet , target : "/scan?reverse=sideways" , want : http .StatusBadRequest },
245+ {name : "empty barrier part" , method : http .MethodGet , target : "/scan?barrier=alpha,,beta" , want : http .StatusBadRequest },
246+ {name : "embedded separator barrier key" , method : http .MethodGet , target : "/scan?barrier=alpha%00beta" , want : http .StatusBadRequest },
245247 }
246248 for _ , tc := range tests {
247249 t .Run (tc .name , func (t * testing.T ) {
@@ -251,6 +253,12 @@ func TestHandleScanRejectsBadQueryAndMethod(t *testing.T) {
251253 if rr .Code != tc .want {
252254 t .Fatalf ("status=%d body=%q" , rr .Code , rr .Body .String ())
253255 }
256+ if tc .want == http .StatusBadRequest {
257+ status := s .node .Status ()
258+ if len (status .Instances ) != 0 || len (status .Executed ) != 0 {
259+ t .Fatalf ("node status after rejected request: instances=%v executed=%v" , status .Instances , status .Executed )
260+ }
261+ }
254262 })
255263 }
256264}
0 commit comments