Merge pull request #43 from hobbyistlabs-coder/sentinel-fix-jules-http-timeout-18134507621557633353
🛡️ Sentinel: [MEDIUM] Fix missing HTTP client timeout in jules API client
This commit is contained in:
commit
f50813b065
1 changed files with 4 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
|
@ -43,7 +44,9 @@ func doRequest(method, url string, body []byte) error {
|
||||||
req.Header.Set("x-goog-api-key", apiKey)
|
req.Header.Set("x-goog-api-key", apiKey)
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
client := &http.Client{}
|
client := &http.Client{
|
||||||
|
Timeout: 15 * time.Second,
|
||||||
|
}
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error making request: %w", err)
|
return fmt.Errorf("error making request: %w", err)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue