Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ linters:
disable-all: true # Disable defaults, then enable the ones we want
enable:
- goimports
- gci
# - gci FIXME uncomment when https://github.com/golangci/golangci-lint/issues/2985 is fixed

# Auto-fix any found issues
issues:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linters:
- stylecheck
- gosec
- goimports
- gci
# - gci FIXME uncomment when https://github.com/golangci/golangci-lint/issues/2985 is fixed

linters-settings:
goimports:
Expand Down
1 change: 1 addition & 0 deletions changes/202207181519.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`[filesystem]` Updated limit structure to have tags specified
1 change: 1 addition & 0 deletions changes/202207181802.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`[httptest]` Fixed security issue `(G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec))`
4 changes: 2 additions & 2 deletions utils/filesystem/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func (n *noLimits) Validate() error {

// Limits defines file system limits
type Limits struct {
MaxFileSize int64
MaxTotalSize uint64
MaxFileSize int64 `mapstructure:"max_file_size"`
MaxTotalSize uint64 `mapstructure:"max_total_size"`
}

func (l *Limits) Apply() bool {
Expand Down
7 changes: 6 additions & 1 deletion utils/http/httptest/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"net"
"net/http"
"testing"
"time"

"github.com/stretchr/testify/require"

Expand All @@ -20,7 +21,11 @@ import (
func NewTestServer(t *testing.T, ctx context.Context, handler http.Handler, port string) {
list, err := net.Listen("tcp", fmt.Sprintf(":%v", port))
require.Nil(t, err)
srv := &http.Server{Handler: handler}
srv := &http.Server{
Handler: handler,
ReadHeaderTimeout: time.Minute,
ReadTimeout: time.Minute,
}
err = parallelisation.DetermineContextError(ctx)
if err != nil {
return
Expand Down