Comments (4)
I have a similar issue and have spent this morning investigating it. It seems that this library computes a different signature than the one in the webhook request headers in some cases.
For example, in my case, I have a webhook projection that contains the following:
"quote": "Our 46th president, @joebiden. I’ve been waiting to post this photo because I knew deep down you would be our next President. Today we celebrate the millions of Americans who overcame barriers to the ballot box, mobilized their communities & voted in record breaking numbers."
You see that &
at the end? It caused the library to compute a different signature than the back-end. When I remove the &
, it works as expected.
from webhook-toolkit.
My workaround:
I removed all data in the projection. I just kept the _id
and the delta::operation()
. Then when the webhook request gets through to my API (it validates correctly because there are no &
s anywhere), and now I use the _id
and the Sanity Client fetch
with CDN turned off to get the fresh data that was previously being sent through the webhook projection.
from webhook-toolkit.
This also happens when expanding references in the projection field. E.g.:
{
...,
topics[] ->
}
The workaround for me was keeping my references as simple as possible. It seems like something nested deeper was causing the signature mismatch for me.
My solution:
{
...,
topics[]-> {
slug
}
}
from webhook-toolkit.
This is now fixed in 2.0.0. Note that this is a breaking change and requires some changes in how you set it up: https://github.com/sanity-io/webhook-toolkit#usage
from webhook-toolkit.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webhook-toolkit.