Skip to content

Commit

Permalink
Remove redundant test for query parameters in REST path
Browse files Browse the repository at this point in the history
  • Loading branch information
cognitivegears committed Jan 4, 2025
1 parent 497cac1 commit 37b3372
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions internal/operators/restpath_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,6 @@ func TestRestPath(t *testing.T) {
}
}

func TestRestPathQueryShouldNotBeIncluded(t *testing.T) {
waf := corazawaf.NewWAF()
tx := waf.NewTransaction()
exp := "/some-random/url/{id}"
path := "/some-random/url/123?name=foo"
rp, err := newRESTPath(plugintypes.OperatorOptions{
Arguments: exp,
})
if err != nil {
t.Error(err)
}
if !rp.Evaluate(tx, path) {
t.Errorf("Expected %s to match %s", exp, path)
}
if tx.Variables().ArgsPath().Get("id")[0] != "123" {
t.Errorf("Expected id value of 123, got %s", tx.Variables().ArgsPath().Get("id"))
}
}

func TestRestPathQueryShouldNotBeGreedy(t *testing.T) {
waf := corazawaf.NewWAF()
tx := waf.NewTransaction()
Expand Down

0 comments on commit 37b3372

Please sign in to comment.