Access headers in SC

I’m using a server action as an API endpoint and I need to be able to pick out meta-data from the header that is sent. Is this possible?

I’m just bumping this with an example…

I need to read the response header in server connect. I am receiving something like this:

And would like to pick for example stripe-signature in server connect so that I can run an action to verify this response originated from Stripe

I have answered my own question, so I will post in case I ever forget or it will help others.

Create a variable under $_SERVER called HTTP_STRIPE_SIGNATURE

5 Likes