Skip to content

Commit 323089d

Browse files
committed
(ci) Fix some more issues found with DeepSource
1 parent eae591b commit 323089d

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

pkg/oauth/oauth.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const (
3838

3939
// HTTP client timeout for API calls.
4040
httpClientTimeout = 30 * time.Second
41+
42+
// Read header timeout for API calls.
43+
readHeaderTimeout = 3 * time.Second
4144
)
4245

4346
var defaultScopes = []string{
@@ -217,7 +220,8 @@ func performOAuthFlow(config *OAuthConfig, httpTimeout time.Duration, openBrowse
217220
errChan := make(chan error, 1)
218221

219222
server := &http.Server{
220-
Addr: defaultPort,
223+
Addr: defaultPort,
224+
ReadHeaderTimeout: readHeaderTimeout,
221225
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
222226
if r.URL.Path == callbackPath {
223227
code := r.URL.Query().Get("code")

pkg/oauth/oauth_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,10 @@ func TestPerformOAuthFlow_ErrorCases(t *testing.T) {
332332
}
333333

334334
// Start a server on the same port to cause a conflict
335-
conflictServer := &http.Server{Addr: defaultPort}
335+
conflictServer := &http.Server{
336+
Addr: defaultPort,
337+
ReadHeaderTimeout: readHeaderTimeout,
338+
}
336339
go func() {
337340
_ = conflictServer.ListenAndServe()
338341
}()

pkg/utils/storage_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
)
1111

1212
func TestFileSystemStorage(t *testing.T) {
13-
t.Parallel()
14-
1513
t.Run("creates directory and saves file", func(t *testing.T) {
1614
// Create temporary directory
1715
tempDir := t.TempDir()
@@ -80,8 +78,6 @@ func TestFileSystemStorage(t *testing.T) {
8078
}
8179

8280
func TestStorageOperations(t *testing.T) {
83-
t.Parallel()
84-
8581
t.Run("storage save and load operations", func(t *testing.T) {
8682
storage := &mockStorage{}
8783

0 commit comments

Comments
 (0)