Webhook header topic key case has changed to small case X-Shopify-Topic

Solved

Webhook header topic key case has changed to small case X-Shopify-Topic

roshh-morfdesk
Shopify Partner
1 0 2

Our app's webhooks suddenly stopped working today because there was a mismatch between the documented header key and the header key received from the webhook request.

It used to be : 

X-Shopify-Topic

But now it is:

x-shopify-topic

 

I just wanted to confirm if Shopify has updated something at their end. Has this occurred to anyone else?

Accepted Solution (1)

JasonH
Community Manager
297 77 269

This is an accepted solution.

We recognize that you'r experiencing some Webhook headers case change.

 

HTTP headers are case insensitive. This isn’t anything specifically for Shopify, it’s HTTP in general. Clients can receive different casing depending on many factors. The best way to make your app future proof is to make it HTTP compliant and compare headers case-insensitive: for example, each app should treat Content-Type and content-type and Content-type the same.

 

For more information, feel free to follow the dev thread here.

JasonH | Community Manager

I help coordinate and curate Community content. Reach out if you have content idea!

View solution in original post

Replies 4 (4)

DavidDB1
Shopify Partner
25 0 21

Yes, and for us it was critical because we did a case-sensitive match for validation.

pcoletta
Visitor
1 0 1

Hi,

recently I received an error due to the format change in the header request sent by Shopify. More precisely the header changed from 'X-Shopify-Token' to 'x-shopify-token'. It isn't a big issue, however, this sudden change does worry me a little bit given no info in this regard have been posted in the Shopify Changelog so I don't know how this change happened. Does anybody know how is this possible?

DavidDB1
Shopify Partner
25 0 21

We had the same issue. For us it was much more critical as all the webhooks failed.

JasonH
Community Manager
297 77 269

This is an accepted solution.

We recognize that you'r experiencing some Webhook headers case change.

 

HTTP headers are case insensitive. This isn’t anything specifically for Shopify, it’s HTTP in general. Clients can receive different casing depending on many factors. The best way to make your app future proof is to make it HTTP compliant and compare headers case-insensitive: for example, each app should treat Content-Type and content-type and Content-type the same.

 

For more information, feel free to follow the dev thread here.

JasonH | Community Manager

I help coordinate and curate Community content. Reach out if you have content idea!