Skip to content

Commit

Permalink
remove vulnerability pointed out by github codeQL analysis
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Cobbett <[email protected]>
  • Loading branch information
techcobweb committed Feb 1, 2024
1 parent 2cefd5c commit a6b5912
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/resources/resourcesApplier.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ func sendResourcesRequestToServer(payloadJsonToSend []byte, apiServerUrl string)
var responseBody []byte
resourcesApiServerUrl := apiServerUrl + "/resources/"

var req *http.Request
req, err = http.NewRequest("POST", resourcesApiServerUrl, bytes.NewBuffer(payloadJsonToSend))
var req *http.Request
req, err = http.NewRequest("POST", resourcesApiServerUrl, bytes.NewBuffer(payloadJsonToSend))

if err == nil {
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
req.Header.Set("Accept-Encoding", "gzip,deflate,br")

log.Printf("sendResourcesRequestToServer url:%s - headers:%s - payload: '%s'", resourcesApiServerUrl, req.Header, string(payloadJsonToSend))
// WARNING:
// Don't leave the following log statement enabled. It might log secret namespace property values, which would be a security violation.
// log.Printf("sendResourcesRequestToServer url:%s - headers:%s - payload: '%s'", resourcesApiServerUrl, req.Header, string(payloadJsonToSend))

var resp *http.Response
client := &http.Client{}
Expand Down

0 comments on commit a6b5912

Please sign in to comment.