@@ -39,13 +39,13 @@ func (httpCapability *HttpCapability) Execute(
3939 command cacao.Command ,
4040 authentication cacao.AuthenticationInformation ,
4141 target cacao.AgentTarget ,
42- variables map [string ]cacao.Variables ) (map [string ]cacao.Variables , error ) {
42+ variables map [string ]cacao.Variable ) (map [string ]cacao.Variable , error ) {
4343
4444 // Get request data and handle errors
4545 method , url , errmethod := ObtainHttpMethodAndUrlFromCommand (command )
4646 if errmethod != nil {
4747 log .Error (errmethod )
48- return map [string ]cacao.Variables {}, errmethod
48+ return map [string ]cacao.Variable {}, errmethod
4949 }
5050 content_data , errcontent := ObtainHttpRequestContentDataFromCommand (command )
5151 if errcontent != nil {
@@ -57,7 +57,7 @@ func (httpCapability *HttpCapability) Execute(
5757 request , err := http .NewRequest (method , url , bytes .NewBuffer (content_data ))
5858 if err != nil {
5959 log .Error (err )
60- return map [string ]cacao.Variables {}, err
60+ return map [string ]cacao.Variable {}, err
6161 }
6262
6363 for key , httpCapability := range command .Headers {
@@ -66,12 +66,12 @@ func (httpCapability *HttpCapability) Execute(
6666 if target .ID != "" {
6767 if err := verifyAuthInfoMatchesAgentTarget (& target , & authentication ); err != nil {
6868 log .Error (err )
69- return map [string ]cacao.Variables {}, err
69+ return map [string ]cacao.Variable {}, err
7070 }
7171
7272 if err := setupAuthHeaders (request , & authentication ); err != nil {
7373 log .Error (err )
74- return map [string ]cacao.Variables {}, err
74+ return map [string ]cacao.Variable {}, err
7575 }
7676 }
7777
@@ -80,22 +80,22 @@ func (httpCapability *HttpCapability) Execute(
8080 response , err := client .Do (request )
8181 if err != nil {
8282 log .Error (err )
83- return map [string ]cacao.Variables {}, err
83+ return map [string ]cacao.Variable {}, err
8484 }
8585 defer response .Body .Close ()
8686
8787 responseBytes , err := io .ReadAll (response .Body )
8888 if err != nil {
8989 log .Error (err )
90- return map [string ]cacao.Variables {}, err
90+ return map [string ]cacao.Variable {}, err
9191 }
9292 respString := string (responseBytes )
9393 sc := response .StatusCode
9494 if sc < 200 || sc > 299 {
95- return map [string ]cacao.Variables {}, errors .New (respString )
95+ return map [string ]cacao.Variable {}, errors .New (respString )
9696 }
9797
98- return map [string ]cacao.Variables {
98+ return map [string ]cacao.Variable {
9999 "__soarca_http_result__" : {Name : "result" , Value : respString }}, nil
100100
101101}
0 commit comments