• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

oxyno-zeta / s3-proxy / 14348138892

08 Apr 2025 01:35PM UTC coverage: 86.087%. Remained the same
14348138892

Pull #570

github

web-flow
fix(deps): update module github.com/prometheus/client_golang to v1.22.0
Pull Request #570: fix(deps): update module github.com/prometheus/client_golang to v1.22.0

5408 of 6282 relevant lines covered (86.09%)

46.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

15.38
/pkg/s3-proxy/server/utils.go
1
package server
2

3
import (
4
        "net/http"
5
        "time"
6

7
        "emperror.dev/errors"
8
        "github.com/oxyno-zeta/s3-proxy/pkg/s3-proxy/config"
9
)
10

11
func injectServerTimeout(svr *http.Server, cfg *config.ServerTimeoutsConfig) error {
32✔
12
        // Check if configuration is empty
32✔
13
        if cfg == nil {
64✔
14
                // Ignore
32✔
15
                return nil
32✔
16
        }
32✔
17

18
        // Check if read timeout is set
19
        if cfg.ReadTimeout != "" {
×
20
                // Parse timeout
×
21
                dur, err := time.ParseDuration(cfg.ReadTimeout)
×
22
                // Check error
×
23
                if err != nil {
×
24
                        return errors.WithStack(err)
×
25
                }
×
26

27
                // Inject
28
                svr.ReadTimeout = dur
×
29
        }
30

31
        // Check if read header timeout is set
32
        if cfg.ReadHeaderTimeout != "" {
×
33
                // Parse timeout
×
34
                dur, err := time.ParseDuration(cfg.ReadHeaderTimeout)
×
35
                // Check error
×
36
                if err != nil {
×
37
                        return errors.WithStack(err)
×
38
                }
×
39

40
                // Inject
41
                svr.ReadHeaderTimeout = dur
×
42
        }
43

44
        // Check if write timeout is set
45
        if cfg.WriteTimeout != "" {
×
46
                // Parse timeout
×
47
                dur, err := time.ParseDuration(cfg.WriteTimeout)
×
48
                // Check error
×
49
                if err != nil {
×
50
                        return errors.WithStack(err)
×
51
                }
×
52

53
                // Inject
54
                svr.WriteTimeout = dur
×
55
        }
56

57
        // Check if idle timeout is set
58
        if cfg.IdleTimeout != "" {
×
59
                // Parse timeout
×
60
                dur, err := time.ParseDuration(cfg.IdleTimeout)
×
61
                // Check error
×
62
                if err != nil {
×
63
                        return errors.WithStack(err)
×
64
                }
×
65

66
                // Inject
67
                svr.IdleTimeout = dur
×
68
        }
69

70
        // Default
71
        return nil
×
72
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc