mirror of
https://github.com/go-gitea/gitea
synced 2025-10-26 08:58:24 +00:00
Move httpsig algs constant slice to modules/setting/federation.go
This commit is contained in:
@@ -29,6 +29,9 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
// Constant slice of httpsig algorithm objects
|
||||
var HttpsigAlgs []httpsig.Algorithm
|
||||
|
||||
func newFederationService() {
|
||||
if err := Cfg.Section("federation").MapTo(&Federation); err != nil {
|
||||
log.Fatal("Failed to map Federation settings: %v", err)
|
||||
@@ -36,4 +39,9 @@ func newFederationService() {
|
||||
log.Fatal("unsupported digest algorithm: %s", Federation.DigestAlgorithm)
|
||||
return
|
||||
}
|
||||
|
||||
HttpsigAlgs = make([]httpsig.Algorithm, len(Federation.Algorithms))
|
||||
for i, alg := range Federation.Algorithms {
|
||||
HttpsigAlgs[i] = httpsig.Algorithm(alg)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user