44 "fmt"
55 "strings"
66
7- "github.com/bytedance/sonic"
87 "github.com/projectdiscovery/nuclei/v3/pkg/output"
98 "github.com/projectdiscovery/nuclei/v3/pkg/testutils"
9+ "github.com/projectdiscovery/nuclei/v3/pkg/utils/json"
1010)
1111
1212var matcherStatusTestcases = []TestCaseInfo {
@@ -26,7 +26,7 @@ func (h *httpNoAccess) Execute(filePath string) error {
2626 return err
2727 }
2828 event := & output.ResultEvent {}
29- _ = sonic .Unmarshal ([]byte (results [0 ]), event )
29+ _ = json .Unmarshal ([]byte (results [0 ]), event )
3030 expectedError := "no address found for host"
3131 if ! strings .Contains (event .Error , expectedError ) {
3232 return fmt .Errorf ("unexpected result: expecting \" %s\" error but got \" %s\" " , expectedError , event .Error )
@@ -43,7 +43,7 @@ func (h *networkNoAccess) Execute(filePath string) error {
4343 return err
4444 }
4545 event := & output.ResultEvent {}
46- _ = sonic .Unmarshal ([]byte (results [0 ]), event )
46+ _ = json .Unmarshal ([]byte (results [0 ]), event )
4747
4848 if event .Error != "no address found for host" {
4949 return fmt .Errorf ("unexpected result: expecting \" no address found for host\" error but got \" %s\" " , event .Error )
@@ -60,7 +60,7 @@ func (h *headlessNoAccess) Execute(filePath string) error {
6060 return err
6161 }
6262 event := & output.ResultEvent {}
63- _ = sonic .Unmarshal ([]byte (results [0 ]), event )
63+ _ = json .Unmarshal ([]byte (results [0 ]), event )
6464
6565 if event .Error == "" {
6666 return fmt .Errorf ("unexpected result: expecting an error but got \" %s\" " , event .Error )
@@ -77,7 +77,7 @@ func (h *javascriptNoAccess) Execute(filePath string) error {
7777 return err
7878 }
7979 event := & output.ResultEvent {}
80- _ = sonic .Unmarshal ([]byte (results [0 ]), event )
80+ _ = json .Unmarshal ([]byte (results [0 ]), event )
8181
8282 if event .Error == "" {
8383 return fmt .Errorf ("unexpected result: expecting an error but got \" %s\" " , event .Error )
@@ -94,7 +94,7 @@ func (h *websocketNoAccess) Execute(filePath string) error {
9494 return err
9595 }
9696 event := & output.ResultEvent {}
97- _ = sonic .Unmarshal ([]byte (results [0 ]), event )
97+ _ = json .Unmarshal ([]byte (results [0 ]), event )
9898
9999 if event .Error == "" {
100100 return fmt .Errorf ("unexpected result: expecting an error but got \" %s\" " , event .Error )
@@ -111,7 +111,7 @@ func (h *dnsNoAccess) Execute(filePath string) error {
111111 return err
112112 }
113113 event := & output.ResultEvent {}
114- _ = sonic .Unmarshal ([]byte (results [0 ]), event )
114+ _ = json .Unmarshal ([]byte (results [0 ]), event )
115115
116116 if event .Error == "" {
117117 return fmt .Errorf ("unexpected result: expecting an error but got \" %s\" " , event .Error )
0 commit comments