Add warning message on Fitbit signature mismatch.
authorFlorian Forster <ff@octo.it>
Mon, 29 Jan 2018 10:54:22 +0000 (11:54 +0100)
committerFlorian Forster <ff@octo.it>
Mon, 29 Jan 2018 10:54:22 +0000 (11:54 +0100)
kraftakt.go

index 66668a6..afb5e4d 100644 (file)
@@ -197,6 +197,7 @@ func fitbitNotifyHandler(ctx context.Context, w http.ResponseWriter, r *http.Req
        // Fitbit recommendation: "If signature verification fails, you should
        // respond with a 404"
        if !fitbit.CheckSignature(ctx, data, r.Header.Get("X-Fitbit-Signature")) {
+               log.Warningf(ctx, "signature mismatch")
                w.WriteHeader(http.StatusNotFound)
                return nil
        }