#asd-webhook-redirect
1 messages · Page 1 of 1 (latest)
Hello 👋
Did you add more logging to your server-side code as suggested in the previous thread?
are you able to print $sig_header ?
What value do you see?
I think that's the issue here
What happens if you print $_SERVER ?
Try printing $_SERVER['HTTP_STRIPE_SIGNATURE']
How are you sending these webhooks to your endpoint? Is this with the CLI or by making things happen on the account? Or are you manually sending them with something like Postman?
I'm just clicking on the link of my webhook, 'cause I don't have the stripe signature headers to send the request with postman
As in you are just navigating to the URL of your webhook in a browser, rather than sending events there?
Gotcha, it would be expected for that header to be empty then
That header is something that Stripe sets on our servers before sending the event out. It only makes sense in the context of a Stripe event and only Stripe makes them, so that header won't show up outside of that context
okay, but that problem appears even if it is stripe to send it
He tested that and it returned the same error
That sounds like it failed similarly but in a different way. Can you try sending an event from Stripe to your endpoint and send me what happens when you print $_SERVER from that if it still can't find that header?
I can't see the response because it gives me 301 status code
If your code doesn't execute when you send an event, it sounds like something in your server's config is causing that
A 301 is a type of redirect code, it might help to check your server logs to see if it is redirecting when it gets requests from our webhook IPs https://stripe.com/docs/ips#webhook-notifications
it executes the code, but only if an error occurs it redirects it to an error landing page
so I cannot see the first page that has been requested
he could see it, if you send me a curl to make requests with signature header to the endpoint I could see that too
Right, that would happen for me too. Now the question is more why this is happening and unfortunately ynoj and I can't figure that out on our side.
You can add it as a header like this if you want to test that way just basically add -H Stripe-Signature: some_random_value
https://reqbin.com/req/c-ea0d5rlb/curl-send-header-example#:~:text=To send an HTTP header,of HTTP headers is unlimited.
okay I'll try, but it is strange 'cause if it is stripe to send the event how is possible that it doesn't find the signature header?
That would either be because Stripe isn't setting it or because your application is modifying something after the event is received. If you have a specific event ID sent to your endpoint from our side, I can double check that we sent the header properly, but you'll need to actually send an event to check that
That being said. I've never not seen this properly set on an event, so it is more likely to be a server side error
We definitely sent that header for that event.
Looks like we actually got the 301 there
I know
So that event probably never reached your actual server as we don't follow redirects. You will need to check why we are getting redirected to another URL when we try to reach out to the one you provided for https://dashboard.stripe.com/webhooks/we_1MRXTfBWfwutbSUWiiAOSy9C
can't you check what is the location where it was redirected?
I DM'd you the URL
asd-webhook-redirect