|
@@ -79,10 +79,11 @@ func GetReadTime(t time.Time) string {
|
|
|
|
|
|
func CheckRequest(ts, sg string) bool {
|
|
func CheckRequest(ts, sg string) bool {
|
|
appSecrets := Config.AppSecrets
|
|
appSecrets := Config.AppSecrets
|
|
-
|
|
+
|
|
- if len(appSecrets) == 0 {
|
|
+ if len(appSecrets) == 0 || sg == "" {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
|
|
+
|
|
for _, secret := range appSecrets {
|
|
for _, secret := range appSecrets {
|
|
stringToSign := fmt.Sprintf("%s\n%s", ts, secret)
|
|
stringToSign := fmt.Sprintf("%s\n%s", ts, secret)
|
|
mac := hmac.New(sha256.New, []byte(secret))
|
|
mac := hmac.New(sha256.New, []byte(secret))
|