mirror of
https://github.com/go-gitea/gitea
synced 2025-07-21 09:48:37 +00:00
Check if digest algo is supported in setting module
This commit is contained in:
@@ -4,7 +4,11 @@
|
||||
|
||||
package setting
|
||||
|
||||
import "code.gitea.io/gitea/modules/log"
|
||||
import (
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
||||
"github.com/go-fed/httpsig"
|
||||
)
|
||||
|
||||
// Federation settings
|
||||
var (
|
||||
@@ -26,5 +30,8 @@ var (
|
||||
func newFederationService() {
|
||||
if err := Cfg.Section("federation").MapTo(&Federation); err != nil {
|
||||
log.Fatal("Failed to map Federation settings: %v", err)
|
||||
} else if !httpsig.IsSupportedDigestAlgorithm(Federation.DigestAlgorithm) {
|
||||
log.Fatal("unsupported digest algorithm: %s", Federation.DigestAlgorithm)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user