Skip to content

Commit

Permalink
Seeding weakrand is no longer necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Jul 21, 2023
1 parent a3844e3 commit d76105d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions modules/caddyhttp/caddyauth/basicauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ import (
"net/http"
"strings"
"sync"
"time"

"github.com/caddyserver/caddy/v2"
"golang.org/x/sync/singleflight"
)

func init() {
caddy.RegisterModule(HTTPBasicAuth{})

weakrand.Seed(time.Now().UnixNano())
}

// HTTPBasicAuth facilitates HTTP basic authentication.
Expand Down
5 changes: 0 additions & 5 deletions modules/caddyhttp/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ import (
"path"
"runtime"
"strings"
"time"

"github.com/caddyserver/caddy/v2"
)

func init() {
weakrand.Seed(time.Now().UnixNano())
}

// Error is a convenient way for a Handler to populate the
// essential fields of a HandlerError. If err is itself a
// HandlerError, then any essential fields that are not
Expand Down
3 changes: 0 additions & 3 deletions modules/caddyhttp/fileserver/staticfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"runtime"
"strconv"
"strings"
"time"

"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
Expand All @@ -38,8 +37,6 @@ import (
)

func init() {
weakrand.Seed(time.Now().UnixNano())

caddy.RegisterModule(FileServer{})
}

Expand Down
3 changes: 0 additions & 3 deletions modules/caddyhttp/reverseproxy/selectionpolicies.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"strconv"
"strings"
"sync/atomic"
"time"

"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig"
Expand All @@ -48,8 +47,6 @@ func init() {
caddy.RegisterModule(QueryHashSelection{})
caddy.RegisterModule(HeaderHashSelection{})
caddy.RegisterModule(CookieHashSelection{})

weakrand.Seed(time.Now().UTC().UnixNano())
}

// RandomSelection is a policy that selects
Expand Down

0 comments on commit d76105d

Please sign in to comment.