"fmt"
"io/ioutil"
"net/http"
- "net/url"
"time"
"github.com/octo/gfitsync/app"
}
func CheckSignature(ctx context.Context, payload []byte, rawSig string) bool {
- base64Sig, err := url.QueryUnescape(rawSig)
+ signatureGot, err := base64.StdEncoding.DecodeString(rawSig)
if err != nil {
- log.Errorf(ctx, "QueryUnescape(%q) = %v", rawSig, err)
- return false
- }
- signatureGot, err := base64.StdEncoding.DecodeString(base64Sig)
- if err != nil {
- log.Errorf(ctx, "base64.StdEncoding.DecodeString(%q) = %v", base64Sig, err)
+ log.Errorf(ctx, "base64.StdEncoding.DecodeString(%q) = %v", rawSig, err)
return false
}