Skip to content
Merged
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
9 changes: 7 additions & 2 deletions internal/api/api.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -20,6 +20,7 @@ import (
"encoding/hex"
"fmt"
"io"
"math"
"net/http"
"net/http/httptrace"
"strings"
Expand Down Expand Up @@ -272,8 +273,12 @@ func handleSubmitTx(c *gin.Context) {

// createHTTPClient with custom timeout
func createHTTPClient(cfg *config.Config) *http.Client {
timeout := int64(60000)
if cfg.Api.ClientTimeout < math.MaxInt64 {
timeout = int64(cfg.Api.ClientTimeout) // #nosec G115
}
return &http.Client{
Timeout: time.Duration(cfg.Api.ClientTimeout) * time.Millisecond,
Timeout: time.Duration(timeout) * time.Millisecond,
Transport: &http.Transport{
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
Expand Down